1 / 13

Printing

Printing. The Printers Collection. We have seen that there is a Forms collection And a collection of objects in each Form frmMyForm There is also a Printers Collection. You can find out printer properties:. ‘Print printer names on the form For Each myPrinter In Printers

sanchezh
Download Presentation

Printing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Printing

  2. The Printers Collection • We have seen that there is a Forms collection • And a collection of objects in each Form frmMyForm • There is also a Printers Collection

  3. You can find out printer properties: ‘Print printer names on the form For Each myPrinter In Printers Form1.Print myPrinter.DeviceName Next

  4. You can find out how many Printers exist: frmMyForm.print Printers.Count

  5. But remember… • Arrays usually start at 0 • So your printers collection is 0-2, not 1-3 EXAMPLES OF PROPERTIES: Printers(0).CurrentX Printers(1).Port Printers(2).PrintQuality

  6. Very Useful Properties • ScaleModevbTwips, vbPixels, vbInches, vbCharacters • CurrentX, CurrentY • Orientation • ColorMode • You can actually choose the printer that has the needed properties

  7. Choosing the Printer: • Set Printer = Printers(1) • Not needed if you are using the default printer

  8. “Building” Printer Output • The printer doesn’t just start printing • Issue NewPage or EndDoc command NewPage is also useful for….Making a New Page!

  9. Controlling Margins • ScaleMode = vbCharacters • ScaleLeft = howManyCharacters • ScaleTop = CharFromTop • ScaleHeight = 10 • ScaleWidth = 10

  10. Printing at a certain spot • CurrentX • CurrentY

  11. 2Things to remember • Warn your users prior to printing • Provide Error-Trapping code (listing 13.6)

  12. Make a print Module • Since many programs will print, you may wish to make a reusable print module.

  13. Printing Graphics • Use AutoRedraw=True when printing the current status of a form. • frmMyForm.PrintFormEasy way to print graphics (the form) • Can print lines, shapes, graphics (next subject).

More Related