how to best repeat a portion of a macro

T

Tony Logan

An example of what I want to do

I have a document full of text and tables where some of the paragraphs begin with a bullet character, then a tab character, then a sentence or two of text, then a paragraph mark. These bulleted paragraphs sometimes appear alone, in groups of two, three, or more

I'm trying to perform the following sequence of actions
1) Find and Replace all bullets followed by a tab with the word "BULLET
2a) Find each instance of the word BULLE
2b) Find the very next instance of a paragraph mar
2c) Replace that paragraph mark with the words "END BULLET" plus a paragraph mar

Item 1 is simple enough, as a find & replace deals with it. But 2a-2c are the stumpers. I suspect some sort of For Each/Next loop might be the answer, but I'm not sure.

Thanks.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?VG9ueSBMb2dhbg==?=,
I'm trying to perform the following sequence of actions:
1) Find and Replace all bullets followed by a tab with the word "BULLET"
2a) Find each instance of the word BULLET
2b) Find the very next instance of a paragraph mark
2c) Replace that paragraph mark with the words "END BULLET" plus a paragraph mark

Item 1 is simple enough, as a find & replace deals with it. But 2a-2c are the stumpers. I suspect some sort of For Each/Next loop might be the answer, but I'm not sure.
You're certainly on the right track :) One of the word.vba newsgroups would have been more appropriate for this questions (this is an end-user group), but I think if you
do a little research on the mvps.org/word site you should find sample code that shows you how to use Do...Loop to work your way through a document using Find/Replace +
some other document manipulation.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :)
 
T

Tony Logan

Thanks. When you said this would have been better addressed to one of the Word.VBA newsgroups, I'm not sure if you mean the "Programming" discussion group, or another site altogether. Can you provide an http address? Thanks. -Ton

----- Cindy M -WordMVP- wrote: ----

You're certainly on the right track :) One of the word.vba newsgroups would have been more appropriate for this questions (this is an end-user group), but I think if you
do a little research on the mvps.org/word site you should find sample code that shows you how to use Do...Loop to work your way through a document using Find/Replace +
some other document manipulation

Cindy Meiste
INTER-Solutions, Switzerlan
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003
http://www.mvps.org/wor
 
S

Suzanne S. Barnhill

If I am not mistaken, the NG labeled "Programming" in the Communities
interface is microsoft.public.word.vba.general or
microsoft.public.word.vba.beginners. In full, these would be:

news://msnews.microsoft.com/microsoft.public.word.vba.general
news://msnews.microsoft.com/microsoft.public.word.vba.beginners

(They're not HTTP but NNTP.) Other Word VBA NGs are:

news://msnews.microsoft.com/microsoft.public.word.vba
news://msnews.microsoft.com/microsoft.public.word.vba.addins
news://msnews.microsoft.com/microsoft.public.word.vba.customization
news://msnews.microsoft.com/microsoft.public.word.vba.userforms

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Tony Logan said:
Thanks. When you said this would have been better addressed to one of the
Word.VBA newsgroups, I'm not sure if you mean the "Programming" discussion
group, or another site altogether. Can you provide an http address?
Thanks. -Tony
----- Cindy M -WordMVP- wrote: -----

You're certainly on the right track :) One of the word.vba
newsgroups would have been more appropriate for this questions (this is an
end-user group), but I think if you
do a little research on the mvps.org/word site you should find sample
code that shows you how to use Do...Loop to work your way through a document
using Find/Replace +
 

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