HI
I have the following function that allows printing internet websites. It works fine however i can't find anything that would help me to define print out settings on the fly (e.g. fit to 1 page change orientation to landscape etc).
I couldn't find anything amongst .ExecWB arguments maybe i am missing something here?
many thanks for your help
Function PrintFromWebsite(sURL As String)
On Error GoTo errorhandler:
Const OLECMDID_PRINT = 6
Const OLECMDEXECOPT_DONTPROMPTUSER = 2
Const PRINT_WAITFORCOMPLETION = 2
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.navigate sURL
Do While .ReadyState <> 4
Loop
.Visible = True
.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
End With
Exit Function
errorhandler:
MsgBox "Website could not be opened due to the folllowing error" & _
vbNewLine & Err.Description, vbExclamation, "ERROR"
End Function
I have the following function that allows printing internet websites. It works fine however i can't find anything that would help me to define print out settings on the fly (e.g. fit to 1 page change orientation to landscape etc).
I couldn't find anything amongst .ExecWB arguments maybe i am missing something here?
many thanks for your help
Function PrintFromWebsite(sURL As String)
On Error GoTo errorhandler:
Const OLECMDID_PRINT = 6
Const OLECMDEXECOPT_DONTPROMPTUSER = 2
Const PRINT_WAITFORCOMPLETION = 2
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.navigate sURL
Do While .ReadyState <> 4
Loop
.Visible = True
.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
End With
Exit Function
errorhandler:
MsgBox "Website could not be opened due to the folllowing error" & _
vbNewLine & Err.Description, vbExclamation, "ERROR"
End Function