You receive a prompt to select a text encoding format when you run a VBA program that was developed in Microsoft Word

Article translations Article translations
Article ID: 870699 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

When you try to open a text file to perform a mail merge in your Microsoft Visual Basic for Applications (VBA) program that you developed in Microsoft Word, you may receive a prompt to select a text encoding format.

CAUSE

This behavior occurs because the plain text file format cannot contain text encoding.

RESOLUTION

To resolve this behavior, you must use a Microsoft Word file as a document file ( a .doc file) to store your data for the mail merge program.

To save an existing text file in Word format, open the text file in Word, and then use the Save As command to save it as a document file. To do this, follow these steps:
  1. Start Word.
  2. In Office Word 2003 or in Word 2002, click Open on the File menu.

    In Office Word 2007, click the Microsoft Office Button, and then click Open.
  3. In the Look in list, click the appropriate drive and folder where your text file resides.
  4. Click the Files of type list, and then click All Files.
  5. In the Open dialog box, click Your_File_Name.txt (where Your_File_Name.txt is the name of your text file), and then click Open.
  6. In Word 2003 or in Word 2002, click Save As on the File menu.

    In Word 2007, click the Microsoft Office Button, and then click Save As.
  7. Click the Save as type list, and then click Word document.
  8. Click Save.
  9. Change the name of the file in your VBA program from Your_File_Name.txt to Your_File_Name.doc.
  10. Run your VBA program for a mail merge.

Properties

Article ID: 870699 - Last Review: December 19, 2006 - Revision: 2.2
APPLIES TO
  • Microsoft Office Word 2007
  • Microsoft Office Word 2003
  • Microsoft Word 2002 Standard Edition
Keywords: 
kbtshoot kbprb KB870699

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com