qbd software ltd [UK]
qprinter > moth > qbd software
qPrinter² qcDocument: Properties and Methods
Applies To:
qcDocument
 
See Also:
Templates
AbsoluteItems
DocumentItems
AddTemplateBlock
AddImage
AddTextBlock
 

AddFormatBlock

Adds a FormatBlock to the Document collection. A FormatBlock contains all the style alignment and border information for the Text to be printed.

Syntax

Object.AddFormatBlock (Text As String, FontName As String, FontSize As Single, FontBold As Boolean , FontItalic As Boolean , FontUnderline As Boolean , FontColor As Long , Align As qePrinterAlign , IndentLeft As Single , IndentRight As Single , Width As Single , bVAlignNextItem As Boolean , bAbsolute As Boolean , KeepWithNext As Boolean , sKey As String, BeforeObject As Variant, AfterObject As Variant, CalculateSize As Boolean )

Parameters
TextThe Text of the FormatBlock to be included in the Document.
FontNameThe font family to use for the Item.
FontSizeThe font size to use for the Item.
FontBoldBold style.
FontItalicItalic style.
FontUnderlineUnderline style.
FontColorForecolor for the Item.
AlignAlignment of the Item on the page: Left, Centre, Right or Full justification.
IndentLeftThe distance from the Left margin to indent the Item.
IndentRightThe distance from the Right margin to indent the Item.
WidthThe width of the item - used in conjunction with IndentLeft and IndentRight.
bVAlignNextItemThe Vertical Alignment of the Item. When set to True the Top of the next item in the Document will be at the same vertical position as this Item.
bAbsoluteSets whether the Item is Absolute - appearing on a specified page at a specified position, or TextFlow where the position is dependent on the other Items in the Document.
KeepWithNextEnsures the Item is not seperated from the next Item by a Page Break.
sKeyThe Key to identify the Item.
BeforeObjectThe Index or Key of the Item the new Item should be placed before in the Document order.
AfterObjectThe Index or Key of the Item the new Item should be placed after in the Document order.
CalculateSizeOptional value to indicate whether the Item's size should be calculated. For large documents this can help speed the Preview/Printing process

Notes

The CalculateSize parameter is only worth using if no further changes to the FormatBlock are to be made. Subsequent changes will require a recalculation of the size.
The example would add a Bold, centered title ("Document Title") to the Document.

Example

' Add a Bold Title to the Document
qPrint.Document.AddFormatBlock "Document Title", "Arial", 12, True, , , , eCentre

See Also: Templates, AbsoluteItems, DocumentItems, AddTemplateBlock, AddImage, AddTextBlock

©2002 qbd software ltd