|
|
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 | | Text | The Text of the FormatBlock to be included in the Document. | | FontName | The font family to use for the Item. | | FontSize | The font size to use for the Item. | | FontBold | Bold style. | | FontItalic | Italic style. | | FontUnderline | Underline style. | | FontColor | Forecolor for the Item. | | Align | Alignment of the Item on the page: Left, Centre, Right or Full justification. | | IndentLeft | The distance from the Left margin to indent the Item. | | IndentRight | The distance from the Right margin to indent the Item. | | Width | The width of the item - used in conjunction with IndentLeft and IndentRight. | | bVAlignNextItem | The 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. | | bAbsolute | Sets 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. | | KeepWithNext | Ensures the Item is not seperated from the next Item by a Page Break. | | sKey | The Key to identify the Item. | | BeforeObject | The Index or Key of the Item the new Item should be placed before in the Document order. | | AfterObject | The Index or Key of the Item the new Item should be placed after in the Document order. | | CalculateSize | Optional 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
|