The File Conversion Encoding dialog box appears when you open a text file (290981)



The information in this article applies to:

  • Microsoft Word 2002

This article was previously published under Q290981
For a Microsoft Word 2000 version of this article, see 817140.
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SYMPTOMS

When you open a text file in Microsoft Word, the File Conversion Encoding dialog box may appear.

CAUSE

Word may automatically detect the encoding standard that is used in a text file. When the file's encoding standard matches the default encoding standard that is used to save files as plain text in the version of Microsoft Windows that you are running, Word opens the file directly. However, when Word cannot determine the encoding standard of the text file that you are opening, Word displays the File Conversion Encoding dialog box to allow you to select the encoding standard that you want to use to open the file.

RESOLUTION

Service Pack Information

This problem is corrected in Office XP Service Pack 3. To resolve this problem, obtain the latest service pack for Microsoft Office XP. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

307841 How to obtain the latest Office XP service pack

How to obtain the hotfix

This issue is fixed in the Word 2002 Post-Service Pack 2 Hotfix Package July 1, 2003. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

823321 Availability of Word 2002 post-Service Pack 2 hotfix package: July 1, 2003

After you install this fix, follow the steps that are listed in the "More Information" section of this article to set the DefaultCPG registry key and to activate the fix.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290140 How to run sample code for the Office XP programs from Knowledge Base articles

To prevent Word from displaying the File Conversion Encoding dialog box, create a macro similar to the following, which opens the text file with the encoding scheme that you specify:
Sub MyOpenDocumentMacro()

   ' Replace the File Name example with the path to your text file.
   Documents.Open FileName:="C:\My documents\Address.txt", _
      Format:=wdOpenFormatText, Encoding:=msoEncodingUSASCII

End Sub
				
For more information about the Encoding property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type encoding in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

MORE INFORMATION

Activate the Post Service Pack 2 Update

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
To activate this fix, follow these steps:
  1. Quit all Microsoft Office applications.
  2. Click Start, and then click Run.
  3. In the Open box, type regedit, and then click OK.
  4. Locate, and then click to select the following registry key:

    HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Options

  5. With the Options key selected, on the Edit menu, point to New, and then click DWORD.
  6. Type DefaultCPG and then press Enter.
  7. Right-click DefaultCPG, and then click Modify.
  8. In the Edit DWORD Value box, select Decimal as the base.
  9. In the Value data box, type 1252 and then click OK.
  10. On the File menu, click Exit to quit Registry Editor.
Note The value of the registry key is the code page you want to use as default. In the example, the number for the Windows Latin-1 code page is used (1252).

When a text file is encoded, it is saved according to an encoding standard, which is a set of rules that assigns a numeric value to each text character in the file.

Many different encoding standards exist to represent the character sets that are used in different languages. Some encoding standards support the characters that are used only in a particular language. For example, a text file written in Simplified Chinese may use the GB2312-80 encoding standard, and a text file written in Traditional Chinese may use Big5.

Because Word is based on the Unicode encoding standard, you can use Word to open and save files in encoding standards for many different languages. For example, you can use Word to open a text file that is encoded in a Greek or Japanese encoding standard on an English-language system.

For more information about encoded text files, click Microsoft Word Help on the Help menu, type about encoded text files in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Office XP Service Pack 3.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbQFE KBHotfixServer kbfix kbBug kbofficexppresp3fix kbmacroexample KB290981