automating changes to "Style for following paragraph"

J

john gibb

Hi,

I frequently change Outline levels in long documents and have setup
specific, and different, styles for what follows my Headings. (Different
indentation is one reason I do this)

For example, assume the "following paragraph" styles 's2' and 's3' are the
names of styles that follow 'Heading 2' and 'Heading 3' styles,
respectively.

I change styles now with keyboard macros, but have to go through the entire
document and invoke the macros where I want the styles to be changed.

Is there a way to further automate so, if I change say, a 'Heading 2' to a
'Heading 3', the "Style for following paragraph" can be changed from 's2' to
's3'?

thanks,

-john
 
C

Charles Kenyon

The style for following paragraph does change automatically. That applies to
paragraphs you create by pressing Enter at the end of your paragraph. It
does not apply to existing paragraphs. The problem is that you want to have
it magically apply to existing paragraphs and it won't.

You can semi-automate the process using Replace and replacing one style s2
with s3. This will still require you to make a decision as to each paragraph
s2 but is quicker than manually applying the style.

You could also add keyboard shortcuts for your s2 and s3 styles so that you
could apply them from the keyboard.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
J

john gibb

Hi Charles,

I appreciate your reply, but after thinking about it a bit more, I am
wondering if this might be possible in VBA, with this sort of algorithm:

for (i = 1 to 9)
if (paragraph.style="Heading " + i)
skip-to-next-paragraph
paragraph.style.set ("s"+ i)

??

My VBA skills are wanting, but maybe a VBA expert can chime in here.

thanks,

-john
 
C

Charles Kenyon

Yes, you could do something like that, but what about the second paragraph
following the heading style, the third, the twenty-seventh? Yes, you can
program for this but it isn't going to be simple. Somewhat simpler would be
to make the original change using a program that also changed any following
paragraphs until the next heading style was encountered. I'm not going to
attempt either, though.
 

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