View Single Post
  #4   Report Post  
Posted to microsoft.public.word.newusers
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default Styles Copying Over Into Another File

"Cookie" wrote:
Unfortunately, they are not named the same (but I do like your
suggestion on how to replace incorrect styles with the correct
styles if they have the same name).

Any other suggestions?


Increase the likelyhood that they have the same name without any tinkering:
Use (and customize) the built-in styles in your templates. If everyone would
stick to the built-in styles, there would hardly be a problem.

BTW, the "Char Char..." character styles can't be easily deleted because
they are linked to paragraph styles.
You can unlink them with a macro such as the one below, which turns them
into regular character styles.
Once you have done that, they can be deleted.
If the document has been created with Word2003 (probably also in an updated
Word2002... not sure), Word will always try to hide the "Char Char" styles
from you. They only become visible after the document has been saved in an
older version (97, 2000).
The macro will also make them visible in Word2003, which helps deal with the
issues they cause.

Regards,
Klaus



Sub ShowlinkstylesUnlink()
' Based on one of Cindy Meister's macros
' (any bugs are mine)
Dim myStyle As Style
Dim myStyleLinkedStyle As Style
' On Error Resume Next
For Each myStyle In ActiveDocument.Styles
If myStyle.Type = wdStyleTypeCharacter Then
Set myStyleLinkedStyle = myStyle.linkstyle
If myStyleLinkedStyle _
ActiveDocument.Styles(wdStyleNormal) Then
If myStyleLinkedStyle.linkstyle = myStyle Then
Select Case MsgBox("The " & _
StyleType(myStyle.NameLocal) & _
" " & Chr(34) & myStyle.NameLocal & Chr(34) & _
" is linked to " & StyleType(myStyle.linkstyle) & _
" " & Chr(34) & myStyle.linkstyle & Chr(34) & _
". " & vbCr _
& "Unlink?", _
vbYesNoCancel + vbInformation, "Styles linked:")
Case vbYes
myStyle.linkstyle = ActiveDocument.Styles("Standard")
myStyleLinkedStyle.linkstyle =
ActiveDocument.Styles("Standard")
If myStyle.linkstyle _
ActiveDocument.Styles(wdStyleNormal) Or _
myStyleLinkedStyle.linkstyle _
ActiveDocument.Styles(wdStyleNormal) Then
MsgBox "Didn't work!", vbCritical
End If
Case vbNo
Case vbCancel
Exit Sub
End Select
End If
End If
End If
Next myStyle
End Sub