Article ID: 886954 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
Suppose that you search a Microsoft Word 2002 document or a Microsoft Office Word 2003 document for a character string. To do this, you click Find on the Edit menu, or you use a Visual Basic for Applications macro. You may experience one or more of the following symptoms:
In a Word 2002 document or in a Word 2003 document, you can locate a character and its combining diacritic mark only when you search for the character together with its combining diacritic mark.
To work around this issue, use one or more of the following methods.
Method 1: Locate all characters that are associated with combining diacritic marks
Method 2: Locate a specific combination of a character and a combining diacritic mark
Method 3: Run a Visual Basic for Applications macro in WordThe following Visual Basic for Applications macro locates all combinations of characters and combining diacritic marks. It replaces each combination with a string. The string is the text "HELLO." Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.
For more information about how to create, to edit, and to run a Word macro, click Microsoft Office Word Help on the Help menu, type macro in the Search for box in the Assistance pane, and then click Start searching to view the topic.
'This Word macro replaces all combinations of a character 'and a combining diacritic mark for a selected part of 'a document. The replacement text is "HELLO." Sub findcombined() 'Clear any formatting that is specified for a find operation. ' Selection.Find.ClearFormatting 'Clear any formatting that is specified for a replace operation. ' Selection.Find.Replacement.ClearFormatting 'Set up a Find and Replace operation. ' With Selection.Find 'Set the Find What string to find all combinations of a character and 'a combining diacritic mark, where &ChrW represents a character and '&H300 and &H36F represent the start and the end of the hexadecimal 'values that correspond to the range of combining diacritical marks 'in Unicode. ' .Text = "?[" &ChrW(&H300) & "-" &ChrW(&H36F) & "]" 'Set the Replace with text to "HELLO." ' .Replacement.Text = "HELLO" 'Set the search direction to search forward in the document. ' .Forward = True 'Set the Find and Replace operation to wrap around to the start 'of the document when the end of the document is reached. This operation makes sure 'that the all the selected part of the document is searched. ' .Wrap = wdFindContinue 'Clear any Format settings. ' .Format = False 'Clear the Match case setting. ' .MatchCase = False 'Clear the Find whole words only setting. ' .MatchWholeWord = False 'Clear the Use wildcards setting. ' .MatchWildcards = True 'Clear the Sounds like setting. ' .MatchSoundsLike = False 'Clear the Find all word forms setting.' .MatchAllWordForms = False End With 'Execute the Find and Replace operation Selection.Find.Execute Replace:=wdReplaceAll End Sub