Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: printform function - no listview detail coming through


Message #1 by Allen Karen <KAllen@O...> on Fri, 30 Mar 2001 12:56:14 +0200
Hi Allen:

Here is something for you to try...This uses APIs
and prints the entire form contents to Printer.

Have Fun
Binu



'Declaration Section--------------------------
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 PrintForm2(frm As Form)
On Error Resume Next

Dim lWidth As Long
Dim lHeight As Long
Dim lX As Long
Dim lY 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
   lX = Screen.TwipsPerPixelX
   lY = Screen.TwipsPerPixelY
   lWidth = Width
   lHeight = Height
   Printer.PaintPicture Clipboard.GetData, 600, 600,
lWidth, lHeight, lX, lY, lWidth, lHeight
   Printer.EndDoc

End Sub
'---------------------------------------------
Private Sub Command1_Click()
    'TEST
    Call PrintForm2(Me)
End Sub
'---------------------------------------------




--- Allen Karen <KAllen@O...> wrote:
> Hi,
>  
> I'm trying to print a form from my application and
> the form itself prints
> fine except for the detail that's in my list view on
> my form. The
> columnheaders in the list view print, it's just the
> detail that's not coming
> through.
>  
> any ideas?
>  
> Thanks,
> Karen.
>  
> 
> binut@y...
> $subst('Email.Unsub')
> 


=====
*********************************
GET YOUR FREE MAIL AT 
<http://www.desiconsultant.com>
*********************************

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text

  Return to Index