Printing a webpage

D.Mair

David
Local time
Today, 05:29
Joined
Jun 1, 2001
Messages
33
Hi,

I have a button that opens multimap at the desired postcode. This works well its really handy however I would now like to open the page, print it after loading, then close the page. Is this possible I am sure it must be....

For those that don’t know www.multimap.com searches for a map of desired location. (Address or postcode)

Thanks David
 
This post is exactly what I'm looking to do (albeit on a different website).

I have code that opens a given web page, but not the code to print it out.

Any ideas/suggestions gratefully received.
 
As is so often the case, I spend an age looking for how to do something, post the question and immediately find the answer.

In case it's of any use to anyone else, the following sub procedure works perfectly: Opens the specified link, prints the page, then closes the link.
Code:
Private Sub Command0_Click()
    Dim str_Webpage As String
    Dim oIExplorer
 
    On Error Resume Next
 
    str_Webpage = {[I]link to webpage[/I]}
 
    Const OLECMDID_PRINT = 6
    Const OLECMDEXECOPT_DONTPROMPTUSER = 2
 
    Set oIExplorer = CreateObject("InternetExplorer.Application")
    oIExplorer.Navigate str_Webpage
    oIExplorer.Visible = 1
 
    Do Until oIExplorer.ReadyState = 4
    Loop
 
    oIExplorer.ExecWB 6, 2, 2, 0 'OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER,PRINT_WAITFORCOMPLETION,0
 
    oIExplorer.Quit
    Set oIExplorer = Nothing
End Sub
 

Users who are viewing this thread

Back
Top Bottom