Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 7 crashing Word Automation
Message
From
15/02/2002 13:20:36
 
 
To
15/02/2002 13:09:08
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00620775
Message ID:
00620783
Views:
15
Your code works "as is" with and without the messagebox on W2K SP2, VFP7 SP1, IE6 as long as the file exists.
Tracy

>Hi all,
>
>some of our applications are automating MS Word to create letters and fill in app data like addresses etc. All of a sudden, the automation won't work anymore. Word will crash on the attempt to open an existing doc and OLE Error 80010105 is returned to VFP. I have reduced the code to the following code snippet, which will reproduce the error with any word doc:
LOCAL loWord
>
>
>loWord = CREATEOBJECT("Word.Application")
>=MESSAGEBOX("blah",64,"blah")                && if this line was commented out, the next line will crash
>loWord.Documents.Open(FULLPATH("Test.doc"))  && OLE Error 80010105 without MessagBox
>loWord.Visible = .T.
>loWord         = .NULL.
>RELEASE loWord
>
The environment is: Win2k SP 2, Word XP, VFP 7 SP 1.
>
>As I found out, it will work as expected if there is any other window of the VFP app coming to foreground between the instantiation of Word.Application and the attempt to open the document. WAIT WINDOW, FOR Loops or the like won't have a positive effect. At least there must be a MessageBox to let it work, like in the snippet above. Throw that line out and you'll see it crash, WINWORD.EXE is floating around in memory, the doc will be destroyed eventually - so don't test it with the only copy of your thesis!
>
>Without the MessageBox the code works fine under VFP 6 SP 4 in the same environment with the same doc.
>
>Anybody able to reproduce that behaviour?
>
>If so, again: is that a bug or a feature?
>
>TIA Robert
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform