MdotButler
Programmer
I have a situation where I am creating a word document from a template. In itself the document is being created as expected. The problem I am encountering is upon exiting word. A dailog box is presented with the following error:
The dialog only has an [OK] button which I am then presented with a save dialog, to save "Normal.dot". If I try to save it I get the same error as above. I then [cancel] the save dialog. Then when I try to exit word, I again get another dialog stating:
If I select [Yes] the first error is presented again, selecting [No] and word closes. With all the above said I am trying to just get out cleanly. I am enclosing the pertinent parts of the VFP code to see if there is something I am doing wrong.
TIS
Mark
Code:
The file is in use by another application or user.
(C:\Documents and Settings\...\Notmal.dot)
Code:
Changes have been made that affect the global templace, Normal.dot, Do you want to save those changes?
Code:
lcTemplate=LOCFILE('BidTemplate.dot','dot','Template:')
loWord=CREATEOBJECT('Word.Application')
loDocument=loWord.Documents.Add(lcTemplate)
....
lcFileName='d:\bid.doc'
loDocument.SaveAs(lcFileName)
loWord.Visible=.T.
loWord.Activate()
RELEASE ALL LIKE lo*
Mark