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.

RE: Redefining a style with formatting changes made in the document by WilliamMeisheid

WilliamMeisheid
Thu Feb 16 15:56:27 CST 2006

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.

Re: Redefining a style with formatting changes made in the document by Cindy

Cindy
Tue Feb 21 04:01:36 CST 2006

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 :-)


Re: Redefining a style with formatting changes made in the documen by WilliamMeisheid

WilliamMeisheid
Tue Feb 21 07:28:26 CST 2006

Cindy,

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

William Meisheid