ActiveX open word document
Posted: Thu Feb 01, 2018 11:26 am
Hi,
I work on automatic generate word documents .
I have one document as "template" where are bookmarks.
And then change this bookmarks to my own values and save document to outdocument.
But I want after it open this document also with ActiveX, because with DC_Spawnurl this is some tome to open it.
How can realize waiting to close document, when I show it in word ?
here sample :
lWordFinished := .f.
oWord := CreateObject("Word.Application")
oWord := oWord:dynamicCast(ActiveXObject())
oWord:Quit := {||lWordFinished := .T.}
oWord:visible := .T. // zobrazuje word dokument počas spracovania
lWordFinished := .f.
oWord:documents:open( outdocument )
???
oDoc:close()
oWord:Quit()
oWord:destroy()
when I try to ??? place put for example this :
do while lWordFinished=.T.
sleep(100)
enddo
application frozen, that I mean, this is not good way.
without anything document open, but in a monent close.
many thanks for any advice
I work on automatic generate word documents .
I have one document as "template" where are bookmarks.
And then change this bookmarks to my own values and save document to outdocument.
But I want after it open this document also with ActiveX, because with DC_Spawnurl this is some tome to open it.
How can realize waiting to close document, when I show it in word ?
here sample :
lWordFinished := .f.
oWord := CreateObject("Word.Application")
oWord := oWord:dynamicCast(ActiveXObject())
oWord:Quit := {||lWordFinished := .T.}
oWord:visible := .T. // zobrazuje word dokument počas spracovania
lWordFinished := .f.
oWord:documents:open( outdocument )
???
oDoc:close()
oWord:Quit()
oWord:destroy()
when I try to ??? place put for example this :
do while lWordFinished=.T.
sleep(100)
enddo
application frozen, that I mean, this is not good way.
without anything document open, but in a monent close.
many thanks for any advice