Page 1 of 1

wxAutomationObject - WORD - File association message blocking the process [SOLVED]

Posted: Mon Sep 19, 2016 4:57 am
by Phil-ok
Hello,
I just installed WORD 2007 on a PC (I had no other available licence for this).
When I create the instance with wxAutomationObject, Word shows a message asking to associate the application with file extensions.
I do this, but the message comes back at each new instance creation.
If I open a file manualy with Word, I have no such message.
Any idea ?
Thanks
Philippe

Re: wxAutomationObject - WORD - File association message blocking the process

Posted: Mon Sep 19, 2016 5:21 am
by PB
When does the message pop up: Immediately after creating the application instance or when trying to open the file?
If it is the latter, have you tried to call

Code: Select all

application.PutProperty("DisplayAlerts", 0); // 0 = wdAlertsNone
prior to opening the file? What is the file extension and format (rtf, doc, docx, docm...)?

BTW, I have been using MS Word for at least two decades, cannot say I remember seeing a file extension association dialog in it. Even if you manage to suppress the dialog, there still may be something odd either in your automation code or MS Word installation.

Re: wxAutomationObject - WORD - File association message blocking the process

Posted: Mon Sep 19, 2016 7:08 am
by Phil-ok
Merci
Voici le code :

Code: Select all

   wxAutomationObject application;

    application.CreateInstance("Word.Application");
    if ( !application.IsOk() )
    {
        errorMsg = _("Failed to create MS Word application instance.");
        return false;
    }
    
Il déclenche le message
mess.png
mess.png (19.47 KiB) Viewed 2330 times
Philippe

Re: wxAutomationObject - WORD - File association message blocking the process

Posted: Mon Sep 19, 2016 7:26 am
by PB
(I do not understand the message in the dialog, but I suppose it says what you wrote in the OP)

Sorry, I have no idea except it must be something wrong with your MS Word/Office install.
So you say the dialog is never displayed when launching MS Word from using its shortcut or via shell using .doc file? Are the file associations set properly and are there no permission issues, e.g. launching MS Word with different rights (or command line parameters) manually then when automation it?

Just to make sure it is not wxWidgets related (which is highly unlikely IMO), please try to automate Word with VBS, i.e. create test.vbs file containing

Code: Select all

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
and observe whether the dialog is displayed or not.

Re: wxAutomationObject - WORD - File association message blocking the process

Posted: Mon Sep 19, 2016 11:43 am
by Phil-ok
Thanks,
I have the same problem with VBA.
It seems the automation tries to start Word 2013 (I didn't know it was installed) for which I have no licence.
Philippe

Re: wxAutomationObject - WORD - File association message blocking the process

Posted: Mon Sep 19, 2016 1:42 pm
by Phil-ok
Hello,
With now only Word 2007 on the PC, everything runs great !
Thanks a lot.
Philippe