This method adds a reference element to the current frame or page.
AddReference (strPage As String, strFrame As String, strElement As String)
strPage Key for page referred, like "Page 2"
strFrame Key for frame referred, like "Inside"
strElement Key for element referred, like "El 3"Remarks:
strPage is case sensitive so Page and not page.
strElement is case sensitive so El and not el.
The space between Page and pagenumber, as well between El and element number is required.
A reference element is added to a kind of collection of the current frame which results in an exact copy of the referred element being displayed in the current frame and accordingly to current font settings. This can be particularly useful when adding some equal elements to every page.
To refer to an element of a certain page the string "El ##" is used.
The element number is generated by any PrintPreview property- or method-assignment in the order of their appearance in the code, like a collection.
To add some elements of page 1 on page 2:
Private Sub Command0_Click()
preview.AddFirstPage ' this is not an Element
preview.FontName = "Times" ' This is Element 1
preview.AddTextAt "this is El 2 of Page 1"
preview.AddTextAt "this is El 3 of Page 1"
preview.FontName = "Courier" 'this is Element 4
preview.AddTextAt "this is El 5 of page 1"
preview.AddPage ' this is not an Element
preview.AddTextAt "this is El 1 of page 2 and is printed in Arial due to default settings of AddPage", 1000, 1000
preview.AddReference "Page 1", "Inside", "El 3" ' This line is on the same place as it was on page 1 only now in Arial
preview.AddReference "Page 1", "inside", "El 4"' This element sets the font to Courier, copied from page 1
preview.AddTextAt "This line is in Courier", 1000, 4000
Come and visit :