<< Click to Display Table of Contents >> VPE ActiveX |
The common sequence of function calls is:
•Set the properties for behavior and appearance of VPE in the design mode or during runtime before calling the method OpenDoc
•Open a document with the method "OpenDoc”
•Use all possible methods to insert VPE objects (like Write(), etc.)
•Use "PageBreak” to generate new pages
•Use "Preview” to show the preview to the user, this is optional
•Use "PrintDoc” to print the document, or WriteDoc() to export it
•Close the document with " CloseDoc”
It is only possible to open one document per VPE-ActiveX. If you want to open multiple documents simultaneously, you need to place the same number of VPE-ActiveX's on the form.
Example for Visual Basic, which can be easily translated to other programming languages:
The following example assumes that you use a VPE-ActiveX object named "Report".
Private Sub Form_Load()
Report.OpenDoc
Report.VpePrint 1, 1, "Hello World!"
Report.Preview
End Sub
This example is very simple. The document is opened, the text "Hello World!" is inserted at position (1, 1) and afterwards the preview is shown.
Informational: the VPE ActiveX is using the Apartment Threading Model.
For a detailed explanation of the basic programming techniques, please continue reading in the "Programmer's Manual" chapter 4 "Programming Techniques".