Well, it's a step in the right direction. However, after implementing the
code in my windows service, I'm able to compile it & install it. But wher I
try to start it up, I get:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in
etasks.exe
Additional information: File or assembly name Interop.SHDocVw, or one of its
dependencies, was not found.
I placed a copy of "Interop.SHDocVw.dll" in C:\Bin. The executable resides
on C:\.
and made the following declaration:
Imports SHDocVw
code follows:
Private ie As SHDocVw.InternetExplorer = New SHDocVw.InternetExplorer
Private WithEvents objClockMonitor As Timers.Timer = New Timers.Timer
Private Sub objClockMonitor_Elapsed(ByVal Sender As Object, ByVal E As
Timers.ElapsedEventArgs) Handles objClockMonitor.Elapsed
Try
ie..Visible = False
ie.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER )
Catch ex As Exception
EventLog.WriteEntry(ex.ToString())
End Try
End Sub
"John A. Bailo" wrote:
Can you expose the print method via the IE COM object,
SHDocVw.dll,SHDocVw.dll?
http://www.c-sharpcorner.com/Code/20...IEInstance.asp
Glenn Venzke wrote: I'm trying to print an Adobe forms file (.fdf) using
system.diagnostics.process in a windows service. The problem is, IE is the
program that launches that file type & Verb = "Print" doesn't work in IE. IE
launches OK but crashes when the verb is invoked. Does anybody know how to do
a shell print command in IE 6? When I specifically states to open the file
using Acrobat, it opens in IE anyway. Code follows:
Dim objProcess As System.Diagnostics.Process
objProcess = New System.Diagnostics.Process
objProcess.StartInfo.FileName = "C:\ClaimReportPdf.fdf"
objProcess.StartInfo.Verb = "Print"
objProcess.StartInfo.CreateNoWindow = True
objProcess.Start()