Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word Object Library

Status
Not open for further replies.

jkb17

Programmer
Nov 27, 2000
156
US
I am accessing a SQL SErver database and creating different reports that are ulitmately exported to MS Word. The client would like to have a printed copy of these reports in addition to the files themselves. There are approximately 100-130 reports to print.

I incorporated the MS Word Object Library into my Visual Basic app and attempted to have VB cycle through all the files, load them into the word object, print the files and then release the object (i.e., set WordObj = nothing). (This was done, obviously, one file at a time).

Is there anything else I should do to make sure that the Word Object is properly released from memory. The system cycled through the files rather rapidly and loaded the Word document too quickly. It resulted in memory errors on my local machine.

Any suggestions to improve performance?

Jim
 
Are you doing a Set WordObj = Word.Application for every file that you want to create and print??

If you are, do this only once, before you go into your loop to create the files, and then do your Set WordObj = Nothing once at the end.

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top