PrintRTFData Method
Top  Previous  Next


Prints an RTF (Rich Text Format) document using data supplied from an RTF object (RTF text box). This method prints the document immediately using the values specified in its arguments. There is no need to use any of the ASP Printer object properties. See remarks below.


Syntax

object.PrintRTFData(RTFData, [DocMarginLeft], [DocMarginTop], [DocMarginRight], [DocMarginBottom],
         
[PrnPaperOrientation], [PrnPaperSize], [PrnPaperBin], [PrnPrintQuality], [PrnCopies])

Where object evaluates to an ASP Printer object.


The PrintRTFData method has these arguments:


PartDescription  


RTFDataString expression specifying the RTF data to print. RTF data can be retrieved from an RTF box using the TextRTF property and passed to this argument to print.  

DocMarginLeft(Optional). A number specifying the left margin (in twips) of the document (default is 1440).  
 
DocMarginTop(Optional). A number specifying the top margin (in twips) of the document(default is 1440).  
 
DocMarginRight(Optional). A number specifying the right margin (in twips) of the document (default is 1440).  
 
DocMarginBottom(Optional). A number specifying the bottom margin (in twips) of the document (default is 1440).  
 
PrnPaperOrientation(Optional). A constant (number) specifying the paper orientation of the printer. See PaperOrientation Property for details.  
 
PrnPaperSize(Optional). A constant (number) specifying the paper size of the printer. See PaperSize Property for details.  
 
PrnPaperBin(Optional). A constant (number) specifying the printer paper bin to use when printing. See PaperBin Property for details.  
 
PrnPrintQuality(Optional). A constant (number) specifying the print quality to use when printing. See PrintQuality Property for details.  
 
PrnCopies(Optional). A number specifying how many copies to print (default is 1).  
 
 



Remarks

This method enables you to print an RTF document using just a single line of code (calling this method). There is no need to set or use any of the ASP Printer object properties. The RTF data is the string read from an RTF box using its TextRTF property.

The following code line shows how to use this method to print an RTF document from an RTF box on your form, using the default values for all arguments:

   ASPPrinter.PrintRTFData Form1.RTFBox1.TextRTF

Note that by using this method, all object properties are ignored, whether set (or not) before calling this method. However, you can choose the printer to send the document to, by using the SetPrinter method before calling this method.

See also the PrintRTFFile method.