eescrihuela General User

Joined: 20 Aug 2010 Posts: 6
|
Posted: Fri Aug 20, 2010 5:01 am Post subject: [SOLVED]mailmerge.execute(Array()) needs application FOCUS ! |
|
|
Hi, I am new to this forum.
I am using Windows XP and OpenOffice 3.1.
I have a macro that tries to make a mail merge. It starts when the document is loaded.
I use the "shell" command from Visual Basic 6.0 to exeute OpenOffice as follows:
shell Full_Path_to_OppenOffice_Writer & " " docname.odt", vbNormalFocus
it runs on another window without getting ther focus, but when the macro reaches to the sentence mailmerge.execute(Array()), it stops running untill you press the mouse button on the OpenOffice window and gets the focus.
If I do not use VB 6 to call OpenOffice (I click twice on the document in the file explorer), the execution of the macro stops untill I minimize the window and get again the focus.
if I put a MsgBox "hello world" just before the mailmerge.execute sentence, and open the document with a double click in the file explorer, then the msgbox is showed and the mailmerge is executed immediately
But this little trick does not work if I use the shell command form VB 6 as the openoffice does not get the FOCUS.
thanks
Eduard
Last edited by eescrihuela on Mon Aug 23, 2010 2:24 am; edited 1 time in total |
|