Microsoft KB Archive/208383

= ACC2000: Print To File Option Inserts Unsupported Characters =

Article ID: 208383

Article Last Modified on 6/30/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q208383



Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you print to a file by using the Print To File option in the Print dialog box, the file created with a Generic/Text Only printer driver contains characters not supported by Microsoft Windows.



RESOLUTION
There are two ways to work around this behavior. One way is to use the Print To File option in the Print dialog box, and then edit the file manually by deleting the unsupported ASCII characters. However, the recommended way is to output the file to a text file. To do this, follow these steps:

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

 Start Microsoft Access and open the sample database Northwind.mdb. In the Database window, click Reports under Objects, and then click New. In the New Report dialog box, click Design View, base the new report on the Categories table, and then click OK. If the Field List box is not displayed, click Field List on the View menu. Drag the CategoryName field to the report's Detail section. Close and save the report as Report1. In the Database window, click Macros under Objects, click New, and then create the following macro:

Macro Action

OutputTo

Action Arguments

--

Object type: Report

Object name: Report1

Object format: MS-DOS Text

Output file: C:\Test.txt

Auto Start: No

</li> Close and save the macro as Macro1.</li> On the Tools menu, point to Macro, and then click Run Macro. In the Run Macro dialog box, select Macro1, and then click OK.</li> Open the C:\Test.txt file in Notepad or another text editor.

Note that there are no unsupported ASCII characters in the Test.txt file, and that the spacing between the controls is close to what it was in Microsoft Access Print Preview.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
The text file that the Print To File option creates contains unsupported ASCII characters in Microsoft Windows, and the formatting of the report does not resemble what you see in Print Preview in Microsoft Access.

Steps to Reproduce Behavior

 * 1) Start Microsoft Access and open the sample database Northwind.mdb.
 * 2) In the Database window, click Reports under Objects, and then click New. In the New Report dialog box, click Design View, base the new report on the Categories table, and then click OK.
 * 3) If the Field List box is not displayed, click Field List on the View menu.
 * 4) From the Field List box, drag the CategoryName field to the report's Detail section.
 * 5) On the File menu, click Print.
 * 6) In the Print dialog box, select the Generic/Text Only printer driver, click Print To File, and then click OK.NOTE: If you do not have the Generic/Text Only driver installed, you must install the driver.

For more information about installing a Generic/Text Only printer, click Microsoft Access Help on the Help menu, type set up a new printer in the Office Assistant or the Answer Wizard, and then click Search to view the topic.


 * 1) When prompted, name the file PrintFile, and then click OK.
 * 2) After the file has been saved, open the file using Notepad or another text editor. Note that there are unsupported characters. Also note that the file's formatting does not resemble the report's spacing in Microsoft Access.

<div class="references_section">