Information générale
Catégorie:
COM/DCOM et OLE Automation
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement