Re: printing using tabs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Mike: Thankl you for your help... ok seems like alot for just some stupid
text boxes that reside o0n the two tabs. How would you do the layout. The
form I'm trying to reproduce is double sided??? It consissts of nothing but
text boxes and some combo boxes for user selections. I just need to send them
to the printer in duplex mode!!!!! What about creating two pages???
I know theres a simple answer for this but I to much of a novice to know
anything!!!

MItch



"Mike Williams" wrote:

.. . . oops! Missed a NewPage in the code I just posted. As it stands the
secondTab will be printed on top of the first. Here's the correct code,
which should print two pages for you:

Option Explicit
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_PAINT = &HF
Private Const WM_PRINT = &H317
Private Const PRF_CLIENT = &H4&
Private Const PRF_CHILDREN = &H10&
Private Const PRF_OWNED = &H20&

Private Sub Form_Load()
With picTemp
.AutoRedraw = True
.BorderStyle = 0
.BackColor = vbWhite
.Visible = False
End With
End Sub

Private Sub Command1_Click()
Dim retval As Long, oldmode As Long
oldmode = Me.ScaleMode
Me.ScaleMode = vbTwips
Printer.Print ""
'
picTemp.Width = picPrint1.Width
picTemp.Height = picPrint1.Height
DoEvents
retval = SendMessage(picPrint1.hwnd, WM_PAINT, picTemp.hdc, 0)
retval = SendMessage(picPrint1.hwnd, WM_PRINT, picTemp.hdc, _
PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Printer.PaintPicture picTemp.Image, 0, 0
'
Printer.NewPage
picTemp.Width = picPrint2.Width
picTemp.Height = picPrint2.Height
DoEvents
retval = SendMessage(picPrint2.hwnd, WM_PAINT, picTemp.hdc, 0)
retval = SendMessage(picPrint2.hwnd, WM_PRINT, picTemp.hdc, _
PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Printer.PaintPicture picTemp.Image, 0, 0
'
Printer.EndDoc
Me.ScaleMode = oldmode
End Sub



.



Relevant Pages

  • FA LP Naomi Cottage Songs SEALED Rare Private
    ... To view Naomi Cottage Songs SEALED Rare Private 390108455742 go to: ... Mike Cooper Do I Know You? ... Morning Glory Two Suns Worth Psych 390108403315 ...
    (rec.music.marketplace.vinyl)
  • Re: Listboxes, text boxes and combo boxes
    ... My code for the form with the combo boxes looks like this: ... Private strisitor As String ... Private firstcriteriaset As Boolean ... Private allempty As Boolean ...
    (microsoft.public.access.forms)
  • Re: Check Box Translated to Text
    ... free tutorial - Word document by Crystal (Access MVP) ... This 30-page training tutorial will orient you toward the core concepts of Microsoft Access -- good foundation for learning programming ... Mike Diamond wrote: ... I am setting up a database with check boxes for Services that are offered. ...
    (microsoft.public.access.modulesdaovba)
  • Re: howdy folks!
    ... Even Mike needs the basic stepstool to reach them. ... strange house, but once he was in he took off happily exploring. ... of nights we slept on air beds in the old house as he couldn't walk on us ... The boxes will be there next week and the week after. ...
    (alt.support.arthritis)
  • Re: moving focus up after pressing arrow up key
    ... > Hi Mike! ... Suppose U have 4 textbox in a input mask. ... text boxes. ... Select Case KeyCode ...
    (comp.lang.basic.visual.misc)