J
JFB
Hello All,
I'm printing word docs using this code in a loop of many documents.
'Start Loop
'Create word App and document
Dim wordApp As Word.Application
Dim wordDoc As Word.Document
'Create the instance of the word document
wordApp = CreateObject("Word.Application")
wordDoc = CreateObject("Word.document")
wordApp.Visible = False
wordDoc = wordApp.Documents.Open(fileName:=docName.ToString)
wordDoc.PrintOut()
'close Word App and kill object
wordDoc.Close()
wordApp.Quit()
wordDoc = Nothing
wordApp = Nothing
'end loop
When I print more than 500 documents my windows 2003 server use 100% of CPU
and only 320mb of memory, doing the print very slow.
The app was in vs 2000 without any issues, I move to vs 2005 and now I have
this problem.
Any ideas how can I improve this? maybe a better way to print word docs.
Thanks in advance.
JFB
I'm printing word docs using this code in a loop of many documents.
'Start Loop
'Create word App and document
Dim wordApp As Word.Application
Dim wordDoc As Word.Document
'Create the instance of the word document
wordApp = CreateObject("Word.Application")
wordDoc = CreateObject("Word.document")
wordApp.Visible = False
wordDoc = wordApp.Documents.Open(fileName:=docName.ToString)
wordDoc.PrintOut()
'close Word App and kill object
wordDoc.Close()
wordApp.Quit()
wordDoc = Nothing
wordApp = Nothing
'end loop
When I print more than 500 documents my windows 2003 server use 100% of CPU
and only 320mb of memory, doing the print very slow.
The app was in vs 2000 without any issues, I move to vs 2005 and now I have
this problem.
Any ideas how can I improve this? maybe a better way to print word docs.
Thanks in advance.
JFB