(Using VFP 9)
Problem: When automating MS Word, I'm using a document template that is the client's letter head. The template loads more slowly than I'd like and so I set ThisForm.Message.visible = .T. ("Creating Word Document...") I'd like to set .Message.Visible = .F. when the user closes the Word document. How can I test for that condition?
I'm hoping that there is a better way than a WAIT command.
Thanks in advance for your help.
Chuck
Problem: When automating MS Word, I'm using a document template that is the client's letter head. The template loads more slowly than I'd like and so I set ThisForm.Message.visible = .T. ("Creating Word Document...") I'd like to set .Message.Visible = .F. when the user closes the Word document. How can I test for that condition?
Code:
#DEFINE CR CHR(13)
#DEFINE CR2 CHR(13) + CHR(13)
*** Other Define Statements ***
THISFORM.MESSAGE.VISIBLE = .T.
RELEASE ALL LIKE o*
PUBLIC oWord
LOCAL oWord, oDocument, oRange
oWord = CREATEOBJECT("Word.Application") && Create Object Reference to MS Word
oDocument = oWord.Documents.ADD("EHMC LETTERHEAD.DOT") && Create Document Based On Template
oRange = oDocument.RANGE()
oRange.InsertAfter(CR2 + MDY(DATE()) + CR2)
oRange.InsertAfter(EVAL.Firm + CR)
*** insert Other Data etc.****
oWord.VISIBLE = .T. && Make the Word Application Visible
*** Test for Word Document Closing prior to next line ****
THISFORM.MESSAGE.VISIBLE = .F. && without wait message is never visible.
I'm hoping that there is a better way than a WAIT command.
Thanks in advance for your help.
Chuck