View Single Post
 
Old 01-11-2012, 05:24 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Marrick,

Something I've noticed is that all of the builtin Table Styles, except for 'Table Normal' are in the error list, as are all of the builtin Character Styles, except for 'Default Paragraph Font' are in the error list. Rather than having all these Styles (and the few other Problem styles) loaded & then all except maybe one or two reported as errors, you could modify the PopulateSourceList sub by adding the following If test to your 'For Each aStyle In ActiveDocument.Styles' loop, thus:
Code:
Dim StrStyExclList As String
StrStyExclList = "|1 / 1.1 / 1.1.1|1 / a / i|Article / Section|"
For Each aStyle In ActiveDocument.Styles
  If aStyle.BuiltIn = True Then
    If aStyle.Type <> wdStyleTypeTable And aStyle.Type <> wdStyleTypeCharacter _
      And InStr(StrStyExclList, "|" & aStyle.NameLocal & "|") = 0 Then
        ListBox1.AddItem (aStyle)
        CountSourceStyles = CountSourceStyles + 1
        lblSourceCount.Caption = "(" & CountSourceStyles & ")"
    End If
  Else
    ListBox1.AddItem (aStyle)
    CountSourceStyles = CountSourceStyles + 1
    lblSourceCount.Caption = "(" & CountSourceStyles & ")"
  End If
Next aStyle
I'd still leave the other error-checking code in, just in case something slips through, but the above should pretty much avoid the problem. You might just need to include a comment somewhere that the builtin Table & Character Styles can't be processed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote