I'm new so please bear with me a bit-- in a .NET application when printing MS Word documents is it preferred to load the Word library such as:
Dim objApp As Word.Application
Dim objDoc As Word.Document
objApp = CType(CreateObject("Word.Application"), Word.Application)
objApp.Visible = False
objApp.ActivePrinter = PDFPrinter
objDoc = objApp.Documents.Open(CType(sFile, Object))
objApp.PrintOut(False, False, 0, CType(sNew, Object), "", "", 0, 1, "", 0, True, False)
objApp.Quit()
or use the process code like:
Dim processHolder As New Process
Dim ProcessStart As New ProcessStartInfo(sFile)
For Each Verb In ProcessStart.Verbs
If Verb.ToLower() = "print" Then
CanPrint = True
ProcessStart.Verb = Verb
Exit For
End If
Next
If CanPrint Then
processHolder = Process.Start(ProcessStart)
End If
Thanks
Bill
Word.Application VS Process.Start(ProcessStart)
Hello,
In the loop you are not creating the Word object each time, right?
You are only looping through:
From what I see you are setting background printing to False, this will speed printing.
I don't know of other ways to speed printing.
In the loop you are not creating the Word object each time, right?
You are only looping through:
Code: Select all
objDoc = objApp.Documents.Open(CType(sFile, Object))
objApp.PrintOut(False, False, 0, CType(sNew, Object), "", "", 0, 1, "", 0, True, False)
From what I see you are setting background printing to False, this will speed printing.
I don't know of other ways to speed printing.