Navigation:  Properties >

FileName Property

Previous pageReturn to chapter overviewNext page

 

Returns or sets a string value specifying the file name from which the document data (title, header, footer and text) will be retrieved and printed (for text files), or the name of the RTF (Rich Text Format) file or HTML (Hypertext Markup Language) file to print.

 

 

Syntax

 

object.FileName [=string]

 

Where object evaluates to an ASP Printer object.

 

 

 

Remarks

 

Simple text files

If the FileName property contains a value (e.g. "c:\myfolder\myfile.txt"), the object will retrieve the document data from that file. This property works in conjunction with the AllDataFromFile property. If the AllDataFromFile property is set to True, the object assumes that all document data (title, header, footer and text) should be read from the file specified in the FileName property and will ignore any text contained in the DocTitle, DocHeader and DocFooter properties. However, if AllDataFromFile is set to False, the object will assume that the file contains only the document text (body). See the AllDataFromFile property for file format details. See also PrintText and PrintTextFile methods.

 

 

Rich Text Format (RTF) files

If the extension of the file name is ".rtf", ASP Printer will assume that the file is an RTF file (in RTF format). The file is processed and is sent to the printer and will be printed exactly as you see it in any RTF text editor (e.g. MS Word). All the formatting settings of the RTF file will be processed and sent to the printer as they appear in the RTF editor.

Note that in the case of RTF files, all property settings of the object are ignored, except the margin settings properties and the printer settings properties (e.g. paper size, orientation, paper bin, etc.). See also the PrintRTFFile and PrintRTFData methods.

 

 

Hypertext Markup Language (HTML) files

If the extension of the file name is ".htm", ".html" or ".mht", ASP Printer will assume that the file is an HTML file (in HTML format). The file is processed and is sent to the printer and will be printed exactly as you see it in your web browser. All the formatting settings of the HTML file will be processed and sent to the printer as they appear in the web browser.

Note that in the case of HTML files, all property settings of the object are ignored, and the settings specified in the HTML file will be considered (e.g. margins, page breaks, etc.). See also the PrintHTMLFile , PrintHTMLDocument, and PrintHTMLDocFromSource methods.