W
WordWorker
I recorded the following macro using the actual keystrokes to reset a
multilevel list. When I run the compiler, it returns no errors, but when I
try to run the macro or step through it, it returns the error message, "That
propertyis not available on that object." I don't understand or have the
foggiest notion of how to fix it. If I go into the multilevel list
everything is there as it should be. I want the macro to run to reset it
because Word 2007 keeps "forgetting" what the setting are after I've closed
the document then open to use it again.
With ActiveDocument.Styles("Level 1 Bullets").ParagraphFormat
.LeftIndent = InchesToPoints(0.56)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.WidowControl = True
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = InchesToPoints(-0.25)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
End With
ActiveDocument.Styles("Level 1 Bullets"). _
NoSpaceBetweenParagraphsOfSameStyle = False
With ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = ChrW(61548)
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleBullet
.NumberPosition = InchesToPoints(0.31)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0.56)
.TabPosition = InchesToPoints(0.56)
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = wdUndefined
.Italic = wdUndefined
.StrikeThrough = wdUndefined
.Subscript = wdUndefined
.Superscript = wdUndefined
.Shadow = wdUndefined
.Outline = wdUndefined
.Emboss = wdUndefined
.Engrave = wdUndefined
.AllCaps = wdUndefined
.Hidden = wdUndefined
.Underline = wdUndefined
.Color = wdUndefined
.Size = wdUndefined
.Animation = wdUndefined
.DoubleStrikeThrough = wdUndefined
.Name = "Wingdings"
End With
.LinkedStyle = "_Level 1 Bullets"
End With
'
' It continues on with the same type of "With" statements for all 9
"ListLevels"
'
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).Name = ""
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
ListGalleries(wdOutlineNumberGallery).ListTemplates(1), _
ContinuePreviousList:=False, ApplyTo:=wdListApplyToSelection, _
DefaultListBehavior:=wdWord10ListBehavior
multilevel list. When I run the compiler, it returns no errors, but when I
try to run the macro or step through it, it returns the error message, "That
propertyis not available on that object." I don't understand or have the
foggiest notion of how to fix it. If I go into the multilevel list
everything is there as it should be. I want the macro to run to reset it
because Word 2007 keeps "forgetting" what the setting are after I've closed
the document then open to use it again.
With ActiveDocument.Styles("Level 1 Bullets").ParagraphFormat
.LeftIndent = InchesToPoints(0.56)
.RightIndent = InchesToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
.WidowControl = True
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = InchesToPoints(-0.25)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
End With
ActiveDocument.Styles("Level 1 Bullets"). _
NoSpaceBetweenParagraphsOfSameStyle = False
With ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = ChrW(61548)
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleBullet
.NumberPosition = InchesToPoints(0.31)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0.56)
.TabPosition = InchesToPoints(0.56)
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = wdUndefined
.Italic = wdUndefined
.StrikeThrough = wdUndefined
.Subscript = wdUndefined
.Superscript = wdUndefined
.Shadow = wdUndefined
.Outline = wdUndefined
.Emboss = wdUndefined
.Engrave = wdUndefined
.AllCaps = wdUndefined
.Hidden = wdUndefined
.Underline = wdUndefined
.Color = wdUndefined
.Size = wdUndefined
.Animation = wdUndefined
.DoubleStrikeThrough = wdUndefined
.Name = "Wingdings"
End With
.LinkedStyle = "_Level 1 Bullets"
End With
'
' It continues on with the same type of "With" statements for all 9
"ListLevels"
'
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).Name = ""
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
ListGalleries(wdOutlineNumberGallery).ListTemplates(1), _
ContinuePreviousList:=False, ApplyTo:=wdListApplyToSelection, _
DefaultListBehavior:=wdWord10ListBehavior