View Single Post
 
Old 12-06-2014, 10:39 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote