But note that Event Handling \(EH\) should come first in the search pattern alternation "(Event Handling \(EH\)|Event Handling)", because if Event Handling comes first as you originally wrote it, it will get replaced first, leaving any (EH) behind. Like in the most popular applications, to find a text in the document, you can use the Ctrl+F shortcut. If you select your passage and run this, text will be replaced as you intended. To help you in finding some text in the document, Word offers two different options. Pattern = "(Event Handling \(EH\)|Event Handling)" As one might assume the search terms will usually not be right next to each other - the macro should find all instances. Note: S-earch3 could also pick up S.earch3 and replace with Search3. Set regExp = CreateObject("vbscript.regexp") And it will search the document and replace with bold and italicized content like so: Search Search1 Search2 Search3 Search4 Search5. If you want to use the full, usual, standard regular expressions, you have to do something like this: Dim regExp As Object Word's built-in Find functionality only supports a limited set of regular expressions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |