Microsoft KB Archive/211775

From BetaArchive Wiki

Article ID: 211775

Article Last Modified on 11/23/2006



APPLIES TO

  • Microsoft Word 2000 Standard Edition



This article was previously published under Q211775

SYMPTOMS

In Microsoft Word 2000, when you run a macro to find or replace a character formatted with a decorative font, such as a Wingdings-formatted character, the macro may not run as expected.

CAUSE

This behavior can occur if the macro was created in an earlier version of Word (Word 6.0 or Word 7.0 for Windows 95) and if that macro uses the Asc function. In Word 2000, this function returns the same ANSC (ANSI) or ACSII character code for all special characters.

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, please 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:


To find and replace a symbol or special characters (characters from fonts not based on the ANSI or ASCII character set), use the FindSymbol macro, which is supplied with Word in the Macros9.dot template. Word Setup places this template in the macros folder of the Office program folder.

How to Install the Macros9.dot Template

To install the Macros9.dot template, follow these steps:

  1. Download the Word 2000 Supplemental Macros file from the following Microsoft Web site:
  2. Download the file (Macros.exe) by clicking Download Now! and following the instructions in the dialog boxes.
  3. Double-click the Macros.exe file on your hard disk to start the Setup program.
  4. Follow the instructions on the screen to complete the installation.

How to Use the Macros9.dot Template

To use the FindSymbol macro to find a symbol or special characters in the current document, follow these steps:

  1. Start Word 2000.
  2. On the File menu, click Open.
  3. In the Files of Type box, click Document Templates (*.dot).
  4. In the Look in box, browse to the location on your hard disk where Macros9.dot is installed.

    Macros9.dot is installed by default to the following folder:

    C:\Program Files\Microsoft Office\Office\Samples

  5. Select Macros9.dot, and then click Open.

    NOTE: If you receive the following message, click Enable Macros. If the Enable Macros button is not available, click to select the Always trust macros from this source check box, and then click Enable Macros.

    C:\Program Files\Microsoft Office\Office\Samples\Macros9.dot contains macros by Microsoft Corporation

    Macros may contain viruses. It is always safer to disable macros, but if the macros are legitimate, you may lose some functionality.

    The security level is set to High. Therefore, you cannot enable macros from sources that you do not trust.

  6. On the Tools menu, point to Macro, and then click Macros.
  7. Click Organizer.
  8. Click the Macro Project Items tab.
  9. Open Macros9.dot in the left pane and Normal.dot in the right pane.

    NOTE: To copy the macro to a different template or file, click Close File to close the Normal template. Then, click Open File and open the template or file that you want.
  10. In the In Macros9.dot box, select FindSymbolsStart, and then click Copy.
  11. In the In Macros9.dot box, select frmFindsymbol, and then click Copy. Click Close.
  12. Close the Macros9.dot template, and then open the document in which you want to use the FindSymbol macro.
  13. On the Tools menu, point to Macro, and then click Macros.
  14. In the Macro Name box, select FindSymbol, and then click Run.
  15. In the Find Symbol dialog box, under Find What, click Symbol to select the symbol that you want to find.
  16. If you want to replace the Find What character with another symbol, select the Replace With option under Replace With, and then click Symbol to select the replacement symbol.

    -or-

    If you want to replace the Find What character with regular text, select the Text option, and then type the replacement text in the Text box.


STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

To find and replace a symbol or special characters (characters from fonts not based on the ANSI or ASCII character set), use the FindSymbol macro, which is supplied with Word in the Macros9.dot template. The Macros9.dot template is a template that contains sample macros created by Microsoft Corp. and is available for download at the following Microsoft Web address:

The Asc function is used to return an integer representing the ANSI value of a symbol character in a macro. When this function is used in Word 2000, it returns the same value (40 or 63, depending on the method that you use to insert the character into your document) for all the decorative font characters.

You can use the following macro to return the ANSI code for a Wingdings character:

Sub ShowANSI()

   'Returns a message box with the ANSI value of the selected character.
   MsgBox Str(Asc(Selection.Range))

End Sub
                

ANSI Value of 40

If you insert a Wingdings font from the Symbol dialog box, the ANSI value for that character is always 40.

To insert the Wingdings font from the Symbol dialog box, follow these steps:

  1. On the Insert menu, click Symbol, and then click the Symbol tab.
  2. In the Font list, select Wingdings.
  3. Click any symbol, click Insert, and then click Close.

If you select the inserted character and run the ShowANSI macro, Word displays a message box on the screen with the value 40. If you repeat steps 1-3 and insert a different Winding character, the value remains 40.

ANSI Value of 63

The ANSI character for a Wingdings character is always 63 if you insert the character by any of the following methods:

  • Use the Character Map.
  • Use a keystroke (such as ALT+0245).
  • Manually change the character font (using the Font list or dialog box).

To see the ANSI value of 63 returned, follow these steps:

  1. In a blank document, click the drop-down arrow in the Font box, and then select the Wingdings font.
  2. Press the K key.


A fancy ampersand is added to your document.

  1. Select the character and run the macro. The ANSI value returned is 63.

For more information about Unicode, please visit the following Unicode Web site:

REFERENCES

For additional information about security levels, click the article numbers below to view the articles in the Microsoft Knowledge Base:

233396 WD2000: How to Reduce the Chances of Macro Virus Infection


192073 WD2000: Error Message: The Macros in the Project Are Disabled


212403 WD2000: How to Use a Macro to Find Special Characters Based on Unicode Value


237356 WD2000: How to Access Sample Macros for Word 2000



Additional query words: vba symbol webdings monotype12

Keywords: kbdownload kbbug kbnofix KB211775