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 a Smart Print Control.
Remarks
·
Simple text files
If the FileName property contains a value (e.g. "c:\myfolder\myfile.txt"), the control 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 control 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 control will assume that the file contains only the document text (body). See the AllDataFromFile property for file format details.
·
Rich Text Format (RTF) files
If the extension of the file name is ".rtf", Smart Print Control assumes 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 control 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.
·
HypertextMarkup Language (HTML) files
If the extension of the file name is ".htm" or ".html", Smart Print Control assumes 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 control are ignored, and the settings specified in the HTML file will be considered (e.g. margins, page breaks, etc.). See also the PrintHTMLFile method.