Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6/Word Automation - Losing Documents reference
Message
De
07/05/2001 08:10:01
 
 
À
05/05/2001 17:32:13
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00503937
Message ID:
00504123
Vues:
22
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform