Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Albuquerque, New Mexico, USA
    Posts
    233
    Thanks
    0
    Thanked 1 Time in 1 Post

    Copying Styles (Word 2002)

    I inherited a document ("Telecomm") created using a bloated Normal.dot (150 styles). I have created a pared-down Procedure.dot template (15 styles). I need help to nuke all the styles in Telecomm so I can go through and apply the styles from Procedure.dot. In particular, I am unable to copy my Procedure.dot Heading 3 to Telecomm.doc using the Organizer. I don't see an existing Heading 3 in either Telecomm.doc or Normal.dot, and I get an "Unable to change built-in style" message.

  2. #2
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copying Styles (Word 2002)

    Hi Sundog,

    My understanding of your problem is that you've created a new template, Procedure.dot, that contains the 15 styles you want to use on the text in Telcomm. You would also like to remove any styles that are in Telcomm that aren't in Procedure.dot.

    Here's what I'd do:
    1. <LI>Create a new document based on Procedure.dot
      <LI>Go to Insert > File, and insert Telcomm
      <LI>Run the macro below
    You'd replace the "myStyle" entries with your 15 style names from Procedure.dot.
    <pre>Sub RemoveNonProcedureStyles()
    Dim varProcedureStyles, v
    Dim sty As Style
    Dim k As Integer
    Dim bMatch As Boolean

    On Error Resume Next

    ' Put your 15 styles in the following array
    varProcedureStyles = Array("myStyle1", "myStyle2", "myStyle3")

    For k = ActiveDocument.Styles.Count To 1 Step -1
    bMatch = False
    Set sty = ActiveDocument.Styles(k)
    For Each v In varProcedureStyles
    If v = sty.NameLocal Then
    bMatch = True
    Exit For
    End If
    Next v
    If Not (bMatch) Then sty.Delete
    Next k
    End Sub
    </pre>



    HTH

  3. #3
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Albuquerque, New Mexico, USA
    Posts
    233
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Copying Styles (Word 2002)

    Thank you Andrew77, that could really help. Will try it next week when time permits.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •