I want to delete all styles from the active document and copy new styles from
another(xyz.dot) template.
What will be the coding?
Thanks
Word Heretic - 28 Sep 2005 13:08 GMT
G'day "donna" <donna@discussions.microsoft.com>,
Usually people want to map old styles to new styles. www.editorium.com
sells megareplacer to do just that really easily and really cheaply.
Steve Hudson - Word Heretic
steve from wordheretic.com (Email replies require payment)
Without prejudice
donna reckoned:
>I want to delete all styles from the active document and copy new styles from
>another(xyz.dot) template.
>
>What will be the coding?
>
>Thanks
Klaus Linke - 29 Sep 2005 18:40 GMT
>I want to delete all styles from the active document and copy
> new styles from another(xyz.dot) template.
>
> What will be the coding?
Hi Donna,
You don't want to delete all styles, since the text would revert to Normal
style.
Copy the styles from the template to the doc, then delete unused styles.
For the second part, you can find macros such as the one from
http://groups.google.com/group/microsoft.public.word.vba.general/browse_frm/thre
ad/40cb22fdea5c5627/2cf2810d6d94d7b4
If you don't want to confirm all the deletions manually, change the "If
.Found = False Then ... End If" to
If .Found = False Then
If myStyle.LinkStyle <> ActiveDocument.Styles(wdStyleNormal) Then
myStyle.LinkStyle = ActiveDocument.Styles(wdStyleNormal)
End If
myStyle.Delete
End If
Regards,
Klaus