I have a frustrating problem with automating Word that I am unable to reproduce. One of my users is getting this error, but I am not, and theoretically, we should have the same pc setup. I basically print a mail-merge Word document on the fly from FoxPro. Here is my code snippet:
IF MESSAGEBOX("Do you want to print the proposal?",36,"Print?"=6
oWord = CREATEOBJECT("word.application"
oword.DisplayAlerts = .f.
oWord.Documents.Open(cWordFile)
oWord.PrintOut()
oWord.Documents.Save(.t.)
oWord.Documents.Close(0)
oWord.quit()
oWord =.NULL.
RELEASE oWord
ENDIF
I added the DisplayAlerts line, the close line, and changed the save line in an effort to kill a fly with a jackhammer and it hasn't worked. I don't even need to save it as there are no changes made, I'm just printing the merged document. When she tries to run this process, she gets a cyptic OLE error first, then clicks ok and the proposal prints fine. Then, Word does not close properly, stalling at the "save as" dialog for Normal.dot (thus, all my "force" code)! Again, I can run this same code and use her same document fine with no prompt and no error. Any suggestions? Is it something in her install or configuration of Word? Thanks in advance!
Jason
IF MESSAGEBOX("Do you want to print the proposal?",36,"Print?"=6
oWord = CREATEOBJECT("word.application"
oword.DisplayAlerts = .f.
oWord.Documents.Open(cWordFile)
oWord.PrintOut()
oWord.Documents.Save(.t.)
oWord.Documents.Close(0)
oWord.quit()
oWord =.NULL.
RELEASE oWord
ENDIF
I added the DisplayAlerts line, the close line, and changed the save line in an effort to kill a fly with a jackhammer and it hasn't worked. I don't even need to save it as there are no changes made, I'm just printing the merged document. When she tries to run this process, she gets a cyptic OLE error first, then clicks ok and the proposal prints fine. Then, Word does not close properly, stalling at the "save as" dialog for Normal.dot (thus, all my "force" code)! Again, I can run this same code and use her same document fine with no prompt and no error. Any suggestions? Is it something in her install or configuration of Word? Thanks in advance!
Jason