Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a Webpage....

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
US
Hey all.. I'm trying to figure out an issue, and I think useing an ActiveX control is the best way of doing it.

What I'm trying to pull off, is to allow a user to be able to use a webpage to enter multiable sets of data, save all that data to a Database.. but then print all of the data to the users default printer.

I understand how to do everything except printing to the printer itself without ANY user interaction.
I know the I can use something like Document.print in JavaScript but this would require the screen to refresh.. making in a Pain on them, me, and the server. =)

and that's what I'm trying to work around..
anyone have any ideas about how to go about pulling this off?
---===///The PogoWolf\\\===---
Darkness..Bleakness..Plastic forks..?

 
I assume you are using the Web Browser control and have included the reference for Internet Controls.
Code:
    Dim eQuery As OLECMDF       'return value type for QueryStatusWB
        
        On Error Resume Next
            eQuery = wbIntranet.QueryStatusWB(OLECMDID_PRINT)  'get print command status
            If Err.Number = 0 Then
                    If eQuery And OLECMDF_ENABLED Then
                        wbIntranet.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""    'Ok to Print?
                    Else
                        MsgBox "The Print command is currently disabled."
                    End If
            End If
            If Err.Number <> 0 Then MsgBox &quot;Print command Error: &quot; & Err.Description
        On Error GoTo 0
 
Looks like that should work.. how would I go about making in an ActiveX control? I'm assuming that I'll need to do the printing from the Clients end, correct?

because the server itself won't know which printer to print to....
---===///The PogoWolf\\\===---
Darkness..Bleakness..Plastic forks..?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top