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

AddTemplateBlock

Adds a FormatBlock to the Template collection that can be used to format TextBlocks. The Template item does not contain Text.

Syntax

Object.AddTemplateBlock (FontName As String, FontSize As Single, sKey As String, 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 , KeepWithNext As Boolean )

Parameters
FontNameThe font family to use for the Template item.
FontSizeThe font size to use for the Template.
sKeyThe Key to identify the Template.
FontBoldBold style.
FontItalicItalic style.
FontUnderlineUnderline style.
FontColorForecolor for the Template.
AlignAlignment of the text 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.
KeepWithNextEnsures the Item is not seperated from the next Item by a Page Break.

Notes

The example adds to Templates to the document and uses these to add different document elements in the specified style.

Example

Dim qTemplate As qcFormatBlock

' Add a Bold Title Template
qPrint.Document.AddTemplateBlock "Arial", 12, "styleTitle", True, , , , eCentre
Set qTemplate = qPrint.Document.Templates("styleTitle")
' Change the Border for the Title Template
qTemplate.BorderColor = vbBlack
qTemplate.ShowBorder = True
qTemplate.BorderStyle = fbsAll
Set qTemplate = Nothing

' Add a Body style Template
qPrint.Document.AddTemplateBlock "Verdana", 11, "styleBody", , , , , eJustify

' Add information to the Document using the Template styles
qPrint.Document.AddTextBlock "Section 1", "styleTitle"
qPrint.Document.AddTextBlock "The text of the section one.", "styleBody"
qPrint.Document.AddTextBlock "Section 2", "styleTitle"
qPrint.Document.AddTextBlock "The text of the section two.", "styleBody"

See Also: Templates, AddFormatBlock, AddTextBlock

©2002 qbd software ltd