Use QAxScriptManager
-
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. -
Hi,
I never tried this, but one thing came into my mind:
what is Document in line 5? You try to use VBScript from MS word inside Qt?
Is there somewhere stated, that "QAxScriptManager":http://doc.qt.nokia.com/latest/qaxscriptmanager.html executes scripts inside the active X objects? I didn't find it.Additionally, to execute the script, you have to call: QAxScriptManager::call(...)
As far as I understood, QAxScriptManager executes windows scripts, not application scripts...