Results 1 to 2 of 2

Thread: Print Document in VB6

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    UAE
    Posts
    191

    Wink Print Document in VB6

    Hello friends,

    After a long time I have been back to vb6. I have worked with PrintDocument in vb.net. Tell me is there any control which can work same as PrintDocument of vb.net.

    Actually I want to create no. of pages at a time and when user clicks print button then all pages should be printed automatically.


    Thanks in advance.
    Each New Difficulty Is Best Opportunity,
    If You Ignore Solving It,
    You Lost Your Life's Best Opportunity.
    _______________________________________
    Dynamic Property value assignment - C#
    TCP client/server connection

    CatchIt-Game
    Fortunes
    SQL Tutorials

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Print Document in VB6

    Typically I use the ShellExecute API
    Code:
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" _
    (ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    
    Private Sub Command1_Click()
    Dim PrintIt As Long
    PrintIt = ShellExecute(Me.hwnd, "PRINT", "C:\My Documents\ishrar.Doc", "", "", -1)
    End Sub

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width