The PRINTING classes 

These classes are designed to allow the layout, preview and printing of text from within a VB application.

There are two classes,

PPpages, which is used to create a set of pages and deals with operations which apply to the WHOLE SET, and

PPpage, which deals with the methods and properties applicable to a SINGLE page.


This class has the following Methods and Properties,

 Method   Operation 
Add Add a page to a collection
delete Delete a page from a collection
mt Empty a collection
page_parms Set the page parameters
set_pinc Set the page number increment, 1 or 2
change_v_bar Change the vertical Scroll bar position †
change_h_bar Change the horizontal Scroll bar position †
zoom Zoom in or out, (Left click), to a maximum of 300% †
switch_zoom Toggle the direction of zoom, (Right click). †
close_preview Close the Preview form †
print_it Print or preview the current page
select_printer Select a printer †
select_Excel_printer Select a printer for use with Excel workbooks
page_setup Set page data via the 'Page Setup' window
font_setup Set font data via the 'Font Setup' window
 Property   Data 
page_data Return page data, margins, etc.
find_index Return the collection index of a page
find_page Return a 'page' object
font_dta Return the current font data
page_col Return a 'pages' collection object

† These methods exist to be accessed by the Preview Form and should not otherwise be used.

The units used for page sizes can be set to either inches or mm. by means of a flag variable.


This class has the following Methods and Properties,

 Method   Operation 
set_object Select an alternative to the Preview form for display
set_p_col Set the background colour of the display object.
add_text Basic text routine. *
add_f_text More advanced text routine. *
add_graphic Adds a graphic images to a page. *
terminate Terminate a line of text.
set_sizes Set the page data, margins, etc. †
set_align Set a global alignment for a page.
page_numbers Add the numbers of a page
set_zoom Set the zoom factor
font Set ALL font parameters
set_font Set a SINGLE font parameter
set_pp Set the Print/Preview flag
head_foot Add header or footer text. *
super_date Construct a date string with days shown as, e.g. 15th.

† This method exists only to transfer page data from a PPpages object and should not otherwise be used.

 Property   Data 
page_number Return the Local or Absolute number of a page
page_flag Return the current Print/Preview flag
page_data Return page data, margins, etc.
font_defaults Return ALL the font parameters from the PPpages object
font_data Return a SINGLE font parameter
centre Return an offset to centre a piece of text
line_height Return the current line separation

add_text is a basic text display routine. It will add a line of text formatted Left, Right or Centre but the text is truncated if longer than a line width.

add_f_text is a more versitile text display routine which will wrap excess text onto a new line, allow Full justification as well as Left, Right and Centre and will recognise the following, in-line font formating codes,

 Code   Action 
\ Start of formating code
/ End of formating code
b Set font Bold
i Set font Italic
u Underline text
t Strike through the text
s Set as superscript
p Set as subscript
k Backspace
y Select 'Symbol' font
w Select 'WingDings' font
d Reselect the default font
q[digits] Set the corresponding QB colour
[digits] Set the point size to the value
n Return to default font values

* More detail on the operation of these methods is given here.