XelaIrodavlas
Registered User.
- Local time
- Today, 21:51
- Joined
- Oct 26, 2012
- Messages
- 175
Hi All,
I'm trying to create a function to automatically open and print a PDF document from a hyperlink inserted in a field, unfortunately I am struggling with the .execWB method.
My code so far is as follows:
Anyone got any ideas? or is there a different method I should use?
All thoughts and ideas appreciated
Thanks,
I'm trying to create a function to automatically open and print a PDF document from a hyperlink inserted in a field, unfortunately I am struggling with the .execWB method.
My code so far is as follows:
Unfortunately while this is loading the PDF no problem, it returns an error on the ExecWB line:Dim MyBrowser As SHDocVw.InternetExplorer
Set MyBrowser = New SHDocVw.InternetExplorer
MyBrowser.Visible = True
MyBrowser.Navigate "C:\MyDocs\Example.pdf"
MyBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
I have spent hours trying to Google an answer but am coming up blank.Run-Time Error '-2147221248 (80040100)':
Method 'ExecWB' of object 'IWebBrowser2' failed
Anyone got any ideas? or is there a different method I should use?
All thoughts and ideas appreciated

Thanks,