Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-05-2016, 03:57 PM
nancy nancy is offline Selecting certain text in word Windows XP Selecting certain text in word Office 2013
Novice
Selecting certain text in word
 
Join Date: Apr 2016
Posts: 3
nancy is on a distinguished road
Default Selecting certain text in word

Hi!

The top of my word document looks like this:

CONFIDENTIAL
Memorandum to
Johnny Damon
cc
Holly Thompson
Tony Bennett

From



I have a bunch of similar word documents in the same folder. The formatting is:

The CONFIDENTIAL is followed by a paragraph symbol, Memorandum to is followed by enter, Johnny Damon is followed by a paragraph symbol, cc is followed by enter, next how ever many names followed by paragraph symbols, then one more paragraph and From is followed by enter.

I want the macro to select Johnny Damon and a separate command to select all the cc names, one by one and then I'm copying and pasting into another table.

I'm fine with the copying and pasting and looping, but I don't know how to get my macro to know what to select. I tried a few things, like ActiveDocument.Sentences(3).Copy which gives me
cc
name

I tried ActiveDocument.Paragraphs(2).Range.Copy and got
Memorandum to
Johnny Damon

I'm running through a bunch of documents on a loop. The Johnny Damon will always be in the same spot, but again, there could be a different number of cc: and I want to pick them up one at a time and stop when there are no more.

Thanks!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting certain text in word Word macro for selecting text and putting it in footnotes mdhg Word VBA 20 03-06-2024 08:07 AM
Selecting and moving text boxes identified by specific text. Chayes Word VBA 8 02-22-2016 07:01 AM
Selecting certain text in word Selecting text between two key phrases Chayes Word VBA 6 06-24-2012 06:54 PM
Selecting styled text Caroline Word 5 02-15-2011 12:55 PM
Selecting a Text Box gajesh Word 0 09-02-2009 11:45 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:26 PM.


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