Paragraph selection in word macro

A

alan.remillard

hello all,
I have a standard word document produced by a macro. Part of this
macro highlights a particular word in red. I need to extend the macro
to then search for this RED word and then move it and ita associated
paragraph to a new page. There could potentially be any number of RED
words and paragraphs to move. Moving the RED word is relatively easy
but moving its associated paragraph I can't do. From within word I can
highlight the paragraph by left clicking it 3 times, how do I achieve
this from within a macro?

If it can be selected then it is easy to move.

regards

Alan
 
J

Jonathan West

hello all,
I have a standard word document produced by a macro. Part of this
macro highlights a particular word in red. I need to extend the macro
to then search for this RED word and then move it and ita associated
paragraph to a new page. There could potentially be any number of RED
words and paragraphs to move. Moving the RED word is relatively easy
but moving its associated paragraph I can't do. From within word I can
highlight the paragraph by left clicking it 3 times, how do I achieve
this from within a macro?

If it can be selected then it is easy to move.

Selection.Paragraphs(1).Range.Select

Or better still, make your macro operate on the range directly without
selecting it.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top