Printing to a File Using the WordBasic FilePrint Statement |
Q106250
.PrintToFile If 1, sends printer instructions to a file.
.PrToFileName If PrintToFile = 1, this parameter specifies the
path and filename of the file to print to.
.AppendPrFile If PrintToFile = 1, this parameter specifies
whether to overwrite or append to the file if it
already exists:
0 (zero) Overwrite
1 Append
The following command prints the contents of the current document to
a file.
FilePrint .PrToFileName = "C:\Temp\Filename.ext", .Type = 0, \
.PrintToFile = 1
If you later want to print the contents of the print file, use the
following Copy syntax at the MS-DOS prompt:
copy /b >filename< LPT1:For more information on the MS-DOS COPY command, refer to pages 389-393 of the "Microsoft MS-DOS User's Guide and Reference" for MS-DOS version 5.0.
Sub MAIN
SendKeys "C:\Temp\Filename.ext" 'the filename to print to
SendKeys "{Enter 2}" 'Send 2 Returns
FilePrint .Type = 0, .PrintToFile = 1
End Sub Additional query words: 2.0 6.0 word6 winword winword2
Keywords : kbmacro kbprint kbmacroexample kbofficeprog
Issue type :
Technology :
|
Last Reviewed: March 28, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |