TerMergePrintVB
Print a document without invoking the editing session in a Visual Basic application.
BOOL TerMergePrintVB(prt, PrtRect, MergeFields, MergeData)
struct StrPrint far *prt; | Print request parameter structure. |
LPRECT PrintRect; | Rectangle to print inside. Pass a NULL value to print on the entire page. |
LPBYTE MergeFields; | Merge fields. Pass a NULL value when merge fields are not used in the document. |
LPBYTE MergeData: | Merge data values. Pass a NULL value when merge fields are not used in the document. |
Description: This function is to be used by a Visual Basic application. This function provides the same functionality as the TerMergePrint function. But since Visual Basic does not allow passing the pointers (PrtRect, MergeFields, and MergeData) inside a structure (StrPrint), this function allows you to pass these values as argument to the function.
Please refer to the TerMergePrint function for the description of the 'prt', 'MergeFields', and 'MergeData' arguments.
This function is prototypes as following in the VB environment:
TerMergePrintVB(prt As StrPrint, ByRef PrintRect As Any, ByVal MergeFields As Any, ByVal MergeData As Any) As Integer
The last three arguments are defined as 'As Any' to allow you to pass a NULL value for these arguments. To pass a NULL value to any of these arguments, pass the value as 'ByVal 0&'.
Example:
result = TerMergePrintVB(prt, ByVal 0&, ByVal FieldNames, ByVal FieldData)
result = TerMergePrintVB(prt, PrtRect, ByVal FieldNames, ByVal FieldData)
result = TerMergePrintVB(prt, PrtRect, ByVal 0&, ByVal 0&)
Please also refer to the dmo_vb project as an example (print option) of using this function.
Return Value: This function returns a TRUE value when successful.
Comments: This function is not available as an ActiveX control method. It must be used as a DLL function.