Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6/Word Automation - Losing Documents reference
Message
From
07/05/2001 08:10:01
 
 
To
05/05/2001 17:32:13
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00503937
Message ID:
00504123
Views:
21
>The code looks like so:
> oWord = CreateObject("Word.Application")
> oDoc = oWord.Documents.Add() && This bombs the SECOND time through
> oRange = oDoc.Range()
> * A whole lot of InsertAfter() and formatting, etc.
>
> oDoc.PrintOut()
> oWord.Application.Quit(0)
> release oWord, oDoc, oRange
>
>Any suggestions would be greatly appreciated.

If you're doing this repeatedly, don't keep instantiating and destroying Word. Instatiate once at the beginning and keep the reference alive until you're done.

That said, I don't see why you're getting an error.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform