J
JFB
Hi All,
I'm printing masive word documents from a folder.
I used a vb.net app under windows 2003 server with word 2003 installed.
The problem is that winword.exe doesn't close in the task manager.
In my developer desktop using xp pro does work using wordDoc.close(false)
Now if I keep wordDoc.close(false) in win2k3 doesn't print at all, but it
does only with wordDoc.close() but keeps winword.exe for every single file.
Any body can help me with this issue?
Thanks
JFB
Here my code that works in XP
Dim NewWordApp As New Word.Application
Dim NewWordDoc As New Word.Document
Dim ps As New Printing.PageSettings
Dim wfName As String
Dim fContent As String
'Create File Name
wfName = "C:\SummaryPage.doc"
'Create the instance of the objects
Try
'for office xp
NewWordApp = CreateObject("Word.Application")
NewWordDoc = CreateObject("Word.document")
Catch
'for office 2000 and 97
NewWordApp = New Word.Application
NewWordDoc = New Word.Document
End Try
NewWordApp.Visible = False
ps.PaperSource = ps.PrinterSettings.PaperSources.Item(3)
'Create File content
fContent = " some content" & vbCrLf & vbCrLf
NewWordDoc.Content.Text = fContent & vbCrLf
NewWordDoc.Content.Font.Size = 10
Try
NewWordDoc.PrintOut()
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
NewWordDoc.SaveAs(wfName)
NewWordDoc.Close()
NewWordApp.Quit(False)
NewWordDoc = Nothing
NewWordApp = Nothing
I'm printing masive word documents from a folder.
I used a vb.net app under windows 2003 server with word 2003 installed.
The problem is that winword.exe doesn't close in the task manager.
In my developer desktop using xp pro does work using wordDoc.close(false)
Now if I keep wordDoc.close(false) in win2k3 doesn't print at all, but it
does only with wordDoc.close() but keeps winword.exe for every single file.
Any body can help me with this issue?
Thanks
JFB
Here my code that works in XP
Dim NewWordApp As New Word.Application
Dim NewWordDoc As New Word.Document
Dim ps As New Printing.PageSettings
Dim wfName As String
Dim fContent As String
'Create File Name
wfName = "C:\SummaryPage.doc"
'Create the instance of the objects
Try
'for office xp
NewWordApp = CreateObject("Word.Application")
NewWordDoc = CreateObject("Word.document")
Catch
'for office 2000 and 97
NewWordApp = New Word.Application
NewWordDoc = New Word.Document
End Try
NewWordApp.Visible = False
ps.PaperSource = ps.PrinterSettings.PaperSources.Item(3)
'Create File content
fContent = " some content" & vbCrLf & vbCrLf
NewWordDoc.Content.Text = fContent & vbCrLf
NewWordDoc.Content.Font.Size = 10
Try
NewWordDoc.PrintOut()
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
NewWordDoc.SaveAs(wfName)
NewWordDoc.Close()
NewWordApp.Quit(False)
NewWordDoc = Nothing
NewWordApp = Nothing