|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro Question: Need help making a macro to highlight the first word in every sentence
Hullo,
I'm new to creating macros in Microsoft Word. (I'm using Microsoft Office Professional Plus 2013). I would love any help or advice y'all can offer! For my English class, I write many essays. With lots of sentences. And I have to highlight the first word in every sentence. I have been doing it manually, going through and highlighting the first word of every sentence "by hand", but that is a lot of work. Is it possible to create a macro to do this? I would appreciate any help. --Lady Ana |
#2
|
||||
|
||||
Unfortunately, no. That's because Word's VBA has no idea what a grammatical sentence is. For example, consider the following:
Mr. Smith spent $1,234.56 at Dr. John's Grocery Store, to buy: 10.25kg of potatoes; 10kg of avocados; and 15.1kg of Mrs. Green's Mt. Pleasant macadamia nuts. For you and me, that would count as one sentence; for VBA it counts as 5... That said, a wildcard Find expression can be used to identify potential candidates, where: Find = [.\!\?][^13^l ]<[A-Z]*> This expression finds any period, exclamation mark or question mark followed by a space, paragraph-break or line-break, followed by a word beginning with a capital letter. If you input this as a Find/Replace expression(Ctrl-H), with the 'Use wildcards' option checked, using the same expression via Ctrl-F in the Navigation pane should highlight all the candidates.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
first word, lady ana, macro |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to highlight a list of words | bakerkr | Word VBA | 4 | 10-19-2017 02:23 PM |
Question about macro in word 2013 | tombags | Word | 1 | 06-25-2014 04:56 PM |
Macro to highlight words | bertietheblue | Word VBA | 9 | 07-01-2013 12:39 PM |
Macro to highlight text between 2 points in word 2010 | jsilva1950 | Word VBA | 2 | 04-25-2013 12:21 AM |
Trying to highlight pasted text in a macro | goldengate | Word VBA | 0 | 09-14-2010 09:41 PM |