Results 1 to 4 of 4

Thread: How to Print vb6.0's active form in landscape format in A4 size paper using vb6 codin

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    14

    How to Print a Active vb form with in A4 size paper without missing

    hi all
    How to Print a Active vb form with in A4 size paper without missing any content in this form

    please help me
    its very urgent



    Regards
    sathik

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

    Re: How to Print a Active vb form with in A4 size paper without missing

    Code:
    Option Explicit
    
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    
    Private Const VK_MENU As Byte = &H12
    Private Const VK_SNAPSHOT As Byte = &H2C
    Private Const KEYEVENTF_KEYUP = &H2
    
    Private Sub cmdPrintForm_Click()
    Dim lWidth As Long, lHeight As Long
        Clipboard.Clear
        Call keybd_event(VK_MENU, 0, 0, 0)
        Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
        DoEvents
        Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0)
        Call keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0)
        Printer.Print
        If Width > Printer.ScaleWidth Then
            lWidth = Printer.ScaleWidth
            lHeight = (Printer.ScaleWidth / Width) * Height
        Else
            lWidth = Width
            lHeight = Height
        End If
        Printer.PaintPicture Clipboard.GetData, 0, 0, lWidth, lHeight
        Printer.EndDoc
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    14

    How to Print vb6.0's active form in landscape format in A4 size paper using vb6 codin

    How to Print vb6.0's active form in landscape format in A4 size paper using vb6 codin?

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: How to Print vb6.0's active form in landscape format in A4 size paper using vb6 c

    Duplicate threads merged - please post each question (or variation of it) only once.

    If you are using Hack's code, simply set Printer.Orientation at some point before the Printer.Print

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