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.

PPpages

This class has the following Methods and Properties,

MethodOperation
AddAdd a page to a collection
deleteDelete a page from a collection
mtEmpty a collection
page_parmsSet the page parameters
set_pincSet the page number increment, 1 or 2
change_v_barChange the vertical Scroll bar position †
change_h_barChange the horizontal Scroll bar position †
zoomZoom in or out, (Left click), to a maximum of 300% †
switch_zoomToggle the direction of zoom, (Right click). †
close_previewClose the Preview form †
print_itPrint or preview the current page
select_printerSelect a printer †
select_Excel_printerSelect a printer for use with Excel workbooks
page_setupSet page data via the 'Page Setup' window
font_setupSet font data via the 'Font Setup' window

PropertyData
page_dataReturn page data, margins, etc.
find_indexReturn the collection index of a page
find_pageReturn a 'page' object
font_dtaReturn 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.

PPpage

This class has the following Methods and Properties,

MethodOperation
set_objectSelect an alternative to the Preview form for display
set_p_colSet the background colour of the display object.
add_textBasic text routine. *
add_f_textMore advanced text routine. *
add_graphicAdds a graphic images to a page. *
terminateTerminate a line of text.
set_sizesSet the page data, margins, etc. †
set_alignSet a global alignment for a page.
page_numbersAdd the numbers of a page
set_zoomSet the zoom factor
fontSet ALL font parameters
set_fontSet a SINGLE font parameter
set_ppSet the Print/Preview flag
head_footAdd header or footer text.*
super_dateConstruct 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.

PropertyData
page_numberReturn the Local or Absolute number of a page
page_flagReturn the current Print/Preview flag
page_dataReturn page data, margins, etc.
font_defaultsReturn ALL the font parameters from the PPpages object
font_dataReturn a SINGLE font parameter
centreReturn an offset to centre a piece of text
line_heightReturn 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, *

CodeAction
\Start of formating code
/End of formating code
bSet font Bold
iSet font Italic
uUnderline text
tStrike through the text
sSet as superscript
pSet as subscript
kBackspace
ySelect 'Symbol' font
wSelect 'WingDings' font
dReselect the default font
q[digits]Set the corresponding QB colour
[digits]Set the point size to the value
nReturn to default font values

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


[Last update: 18/11/2007]