Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Restore default styles (Word 2000>)

    Hi all,

    Is there a way to restore all of Words default styles and delete all the user customized styles quickly. I have a friend that recieved a large doc that is peppered with customised styles and influencing the functionality of the TOC too! Just like there is a reset button for restoring the toolbars, is there some way to simply get rid of all custom styles and get back to the style list as it was when Word was installed for the first time???

    Maybe a macro or some add in to refresh the styles list!
    TX
    Regards,
    Rudi

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Restore default styles (Word 2000>)

    Try

    Sub ResetStyles()
    Dim i As Integer
    For i = ActiveDocument.Styles.Count To 1 Step -1
    If ActiveDocument.Styles(i).BuiltIn = False Then
    ActiveDocument.Styles(i).Delete
    Debug.Print ActiveDocument.Styles(i)
    End If
    Next i
    ActiveDocument.UpdateStyles
    End Sub

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Restore default styles (Word 2000>)

    Tx...

    I'll give it a try!
    Regards,
    Rudi

  4. #4
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Restore default styles (Word 2000>)

    Hans,

    The code did something and nothing too?? I can't explain it?

    I copied your code into the normal template first. Then ran it. I noticed that it removed the styles that were not linked to the normal template. (IE, those styles created and not added to the template). All the other styles that were added to the template when created stayed there?? I then copied the code into modules in the documents that contained the styles, ran it there, and no change occured. The styles added to the template are still visible in the styles list.

    Any ideas?
    TX
    Regards,
    Rudi

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Restore default styles (Word 2000>)

    Try single-stepping through the code to see which styles are considered to be built-in.

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Restore default styles (Word 2000>)

    The basic loop in the code will remove any styles not built in (and the places in the document where these styles were used now become 'Normal"). Then the Update Styles line reimports all the styles from the attached template.

    If you don't want the styles to reappear in the document after deleting them then you should remove them from the template as well (or not update the styles).
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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