PrintRTFFile Method
Top  Previous  Next


Prints an RTF (Rich Text Format) document from an RTF file (*.rtf). 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.PrintRTFFile(RTFFileName, [DocMarginLeft], [DocMarginTop], [DocMarginRight], [DocMarginBottom],
         
[PrnPaperOrientation], [PrnPaperSize], [PrnPaperBin], [PrnPrintQuality], [PrnCopies])

Where object evaluates to an ASP Printer object.


The PrintRTFFile method has these arguments:


PartDescription  


RTFFileString expression specifying the RTF file to print. The RTF file can have any extension but must be a valid RTF file.  

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 howmany copies to print (default is 1).  
 
 



Remarks

This method enables you to print an RTF document form an RTF file 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 following code line shows how to use this method to print an RTF document from an RTF file, using the default values for all arguments:

   ASPPrinter.PrintRTFFile "C:\MyRTFFile.RTF"

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

An alternative method to print an RTF file is by specifying the FileName property and then calling the PrintDoc method. In this case, the file must have a ".rtf" extension.

See also the PrintRTFData method.