[Solved] Automate IE print dialog box without using SendKeys [closed]


It is, by using the InternetExplorer object’s ExecWB method (see this link for details).

After adding a reference to the Microsoft Internet Controls library to your project, the following example should get you started:

Option Explicit

Sub PrintWebPage()

    Dim ie As InternetExplorer

    Set ie = New InternetExplorer

    ie.Navigate "http://www.google.com/"
    ie.Visible = 1

    'Wait for page to finish loading
    Do While ie.ReadyState <> READYSTATE_COMPLETE
     DoEvents
    Loop

    ie.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER

    MsgBox "Done printing.", vbInformation

End Sub

1

solved Automate IE print dialog box without using SendKeys [closed]