4 Replies - 7931 Views - Last Post: 09 August 2009 - 12:09 AM Rate Topic: -----

#1 Brandonsmule112  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 30-July 09

Printing Page Setup to resize form for normal paper.

Post icon  Posted 06 August 2009 - 02:47 PM

Okay, yet again. I have come to another snag in my project.

I have managed to make everything else work exactly as I would like it to, but when it comes to printing from the Common Dialog.

I have 43 Text Boxes, 44 Labels, 1 Save, 1 Load, 1 Print button [as well as a shitload of form modifying code]

I have managed to get it to print, but for the business I need it to print full page [8.5 x 11in] paper. As of now the form is 10370 x 8880 [I have no idea what it is. It's not pixels obviously] Instead of making a big form that is 8.5 x 11 inches, I would like to be able to press the print button and have a Page Setup to where I can set up the form to print as I would need.

This is my print code, I'm sure that you will understand that I'm not going to post the other 500+ lines.

Private Sub Command3_Click()
  Dim BeginPage, EndPage, NumCopies, i
  ' Set Cancel to True
  CommonDialog1.CancelError = True
  On Error GoTo ErrHandler
  ' Display the Print dialog box
  CommonDialog1.ShowPrinter
  ' Get user-selected values from the dialog box
  BeginPage = CommonDialog1.FromPage
  EndPage = CommonDialog1.ToPage
  NumCopies = CommonDialog1.Copies
  For i = 1 To NumCopies
	Me.PrintForm
  Next i
  Exit Sub
ErrHandler:
  ' User pressed the Cancel button
  Exit Sub
End Sub


I appreciate the help in advance. Thank you. =]

Is This A Good Question/Topic? 0
  • +

Replies To: Printing Page Setup to resize form for normal paper.

#2 June7  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 104
  • View blog
  • Posts: 904
  • Joined: 09-December 08

Re: Printing Page Setup to resize form for normal paper.

Posted 06 August 2009 - 04:46 PM

Please clarify, doesn't your output print to 8.5x11 even though it is designed smaller? You want to print the output to fill the page?

Those dimensions might be twips (1 inch = 1440 twips). In VBA/Access found I had to use twips when wanted to set Width or Top (but not Left) properties of a control, examples:
Me.linDensLine.Width = 9720
Me.tbxLabelNo8.Top = 4079.952
Me.tbxBox1.Width = 11520
If I am correct, then your design is 7.2" W x 6.2" L ?
Was This Post Helpful? 0
  • +
  • -

#3 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: Printing Page Setup to resize form for normal paper.

Posted 07 August 2009 - 12:45 AM

That is if TwipsPerPixelX = 15...

A couple of things for you to check out...

Me.PrintForm

Printer.PaintPicture



Good Luck

This post has been edited by vb5prgrmr: 07 August 2009 - 12:45 AM

Was This Post Helpful? 0
  • +
  • -

#4 Brandonsmule112  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 30-July 09

Re: Printing Page Setup to resize form for normal paper.

Posted 08 August 2009 - 01:02 PM

Yeah, I've heard of twips before. Just wasn't positive.


Yes, it still prints to a 8.5x11 paper, but it only takes up about the top left quarter of it. I would like it to take up an entire paper.
Was This Post Helpful? 0
  • +
  • -

#5 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: Printing Page Setup to resize form for normal paper.

Posted 09 August 2009 - 12:09 AM

Search for Screen Capture code (look for the option to capture only the form) then use Printer.PaintPicture.


Good Luck
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1