|
|
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 | | FontName | The font family to use for the Template item. | | FontSize | The font size to use for the Template. | | sKey | The Key to identify the Template. | | FontBold | Bold style. | | FontItalic | Italic style. | | FontUnderline | Underline style. | | FontColor | Forecolor for the Template. | | Align | Alignment of the text 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. | | KeepWithNext | Ensures 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
|