Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Saving Time - Expanding Based On Style to Unique Style

6 views
Skip to first unread message

Richard

unread,
Jan 23, 2002, 12:46:52 PM1/23/02
to
Can anybody help me out. I am creating a some new styles from some
existing styles in a document. The existing styles are based on other
styles. I want to create new styles that have all the formatting of
the existing styles, but without the reference to the based on styles.
I want to somehow copy the base existing style into the new
style...like expanding it out with out the reference. In this my new
styles are truely stand alone and not based on other styles.

I know about the "no style" in the based on combo box in the Style
dialogue box. I want to get all the style formatting information
copyied absolutely from an exisitng style but with out referencing it.
The only other way is for me to take a long time creating brand new
styles and setting everytning. Surely, there must be a way to copy a
style to a new, but leaving out all references to the based on style.
What I want to avoid is when someone changes the based on style and
have it ripple thru my document.

PLEASE CAN ANY ONE HELP

Charles Kenyon

unread,
Jan 23, 2002, 2:32:05 PM1/23/02
to
Hi Richard,

There is no such ability built into Word (at least through Word 2000). I
believe that the WOPR utility has a button to do this but could be mistaken.
<URL: http://www.wopr.com>
--
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.

"Richard" <rsi...@acclivitydev.com> wrote in message
news:e1b4f52e.02012...@posting.google.com...

Jay Freedman

unread,
Jan 23, 2002, 5:57:03 PM1/23/02
to
Hi, Richard,

As Charles told you, there isn't any built-in facility for this. However,
here's a quick-and-dirty macro to do it:

Sub RebaseStyles()
Dim myOldStyle As Style, myNewStyle As Style
Dim StylesToChange(), NewStyleNames()
Dim nStyle As Integer

StylesToChange = Array("Style1", "Style2")
NewStyleNames = Array("NewStyle1", "NewStyle2")

For nStyle = 0 To UBound(StylesToChange)
Set myOldStyle = ActiveDocument.Styles(StylesToChange(nStyle))
Set myNewStyle = ActiveDocument.Styles.Add(NewStyleNames(nStyle), _
myOldStyle.Type)

myNewStyle.BaseStyle = "" ' (no style)

With myOldStyle
myNewStyle.Font = .Font
myNewStyle.ParagraphFormat = .ParagraphFormat
' myNewStyle.Frame = .Frame
myNewStyle.Borders = .Borders
' myNewStyle.ListTemplate = .ListTemplate
End With
Next nStyle
End Sub

Put the names of the styles you want to "copy" into the first Array, and put
the names you want for the new styles in the same order into the second
Array -- there must be exactly the same number of each.

I got errors trying to copy the .Frame and .ListTemplate properties from one
style to another (this isn't really my area, but I knew some of it wasn't
going to work <g>). If your styles don't use those formats, then just leave
them commented out. If you need them, we can work on something.

The macro as written creates the styles only in the current document. If you
want to alter the styles in the underlying template, open that template as a
document (from the File/Open dialog) before running the macro.

--
Regards,
Jay Freedman
Microsoft Word MVP Word MVP FAQ site: http://www.mvps.org/word

"Richard" <rsi...@acclivitydev.com> wrote in message
news:e1b4f52e.02012...@posting.google.com...

0 new messages