Microsoft KB Archive/65156

Macro EditSearchChar Does Not Ignore Underlining Property

PSS ID Number: Q65156 Article last modified on 02-18-1993

1.00 1.10 1.10a 2.00 WINDOWS

Summary: In a macro, EditSearchChar will search only for text that is not underlined. If you try to search for text (which may be underlined and not underlined at different points throughout the document) only the text that is not underlined will be found. Microsoft has confirmed this to be a problem in Word for Windows version 1.0. This problem was corrected in version 1.1.

More Information: To illustrate this problem, do the following: 1. Create a document with text statements that have different formatting, as follows: anyword (plain) anyword (bold) anyword (bold underlined) anyword (underlined) 2. Start recording a macro, for example “macro1.” (From the Macro menu, choose Record.) 3. From the Edit menu, choose Search. Type “anyword” (without the quotation marks) as the search text. Press CTRL+B for bold. The first bold “anyword” will be found. 4. From the Macro menu, choose Stop Recording. 5. From the Edit menu, choose Search and select OK. Note the bold underlined “anyword” is found. 6. Type “^Home” (without the quotation marks). 7. From the Macro menu, choose Run and select “macro1.” Note the first bold “anyword” will be found. 8. From the Macro menu, choose Run and select “macro1.” Note that the second (bold underlined) “anyword” is NOT found. In Word for Windows version 2.0, the following will illustrate that the problem has been corrected: 1. Create a document with text statements that have different formatting, as follows: anyword (plain) anyword (bold) anyword (bold underlined) anyword (underlined) 2. From the Tools menu, choose Record Macro and choose OK to record macro1, for example. 3. From the Edit menu, choose Find. Type “anyword” (without the quotation marks) as the search text. Press CTRL+B for bold. Choose Find Next. The first bold “anyword” will be found. 4. From the Tools menu, choose Stop Recorder. 5. From the Edit menu, choose Find and select Find Next. Note the bold underlined “anyword” is found. 6. Position the cursor at the top of the document and choose Macro from the Tools menu and run the recorded macro. The first bold “anyword” will be found. 7. From the Tools menu, choose Macro and run the recorded macro again. The second (bold underlined) “anyword” will be found also.

Additional reference words: w4wmacro 1.00 1.10 1.10a 2.0 2.00 noupd