PDA

View Full Version : QAxScriptManager



virus
22nd March 2011, 14:33
Hello. I want to use QtScript in MS Word. I never did it and wrote an example:

QAxObject *WordApplication = new QAxObject("Word.Application", this);
WordApplication->setProperty("Visible", true);
QAxScriptManager *scriptManager = new QAxScriptManager(this);
scriptManager->addObject(WordApplication);
scriptManager->load("Documents.Add.TypeText(\"Hello :)\")", "myscript", "JavaScript");
but it does not work. Please help me with errors and if there is - to give a piece of working code.