Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2014, 04:08 PM
LadyAna LadyAna is offline Macro Question: Need help making a macro to highlight the first word in every sentence Windows 7 64bit Macro Question: Need help making a macro to highlight the first word in every sentence Office 2013
Novice
Macro Question: Need help making a macro to highlight the first word in every sentence
 
Join Date: Dec 2014
Posts: 1
LadyAna is on a distinguished road
Question 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
Reply With Quote
  #2  
Old 12-06-2014, 10:39 PM
macropod's Avatar
macropod macropod is offline Macro Question: Need help making a macro to highlight the first word in every sentence Windows 7 64bit Macro Question: Need help making a macro to highlight the first word in every sentence Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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
Reply

Tags
first word, lady ana, macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Question: Need help making a macro to highlight the first word in every sentence Macro to highlight a list of words bakerkr Word VBA 4 10-19-2017 02:23 PM
Macro Question: Need help making a macro to highlight the first word in every sentence Question about macro in word 2013 tombags Word 1 06-25-2014 04:56 PM
Macro Question: Need help making a macro to highlight the first word in every sentence Macro to highlight words bertietheblue Word VBA 9 07-01-2013 12:39 PM
Macro Question: Need help making a macro to highlight the first word in every sentence 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft