Redefining a style with formatting changes made in the document

W

William Meisheid

I want to use VBA to redefine the underlying paragraph style with the
formatting changes I applied to the paragraph in the document, so I don't
have to manually go to the Styles Task pane and use the "Update To Match
Selection". I then want to apply that changed style to the attached template
and save it.
 
W

William Meisheid

I should have noted that I already know how to deternine the underlying style
name and save that style to the template using the Application.OrganizerCopy
command. What I don't know how to do is apply the current formatting to the
underlying style.

Thanks.
 
C

Cindy M -WordMVP-

Hi William,
I want to use VBA to redefine the underlying paragraph style with the
formatting changes I applied to the paragraph in the document, so I don't
have to manually go to the Styles Task pane and use the "Update To Match
Selection". I then want to apply that changed style to the attached template
and save it.
I just tried recording the actions in a macro and guess what? Word's internal
code to redefine a style goes through the single steps of determing what the
current formatting is and applying that to the style definition.

So that leaves the old workaround of trying to figure out the command name, and
running that using the WordBasic object. This worked for me:

WordBasic.RedefineStyle
I should have noted that I already know how to deternine the underlying style
name and save that style to the template using the Application.OrganizerCopy
command. What I don't know how to do is apply the current formatting to the
underlying style.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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

William Meisheid

Cindy,

Thanks for the "work around". Will let you know if I have any other problems
getting it to work.

William Meisheid
 

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