General information
Category:
COM/DCOM and 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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only