S
supersub15
Hi there,
I have a document where some of the text with the "Caption" style have
the "Keep with Next" option checked. I want to loop through all the
Caption styles and uncheck the option.
I created this macro, but it is not really looping. It gets stuck on
the first occurrence and doesn't move to the next Caption style.
With ActiveDocument.Content.Find
.ClearFormatting
.Style = "Caption"
Do While .Execute(FindText:="", Forward:=True, Format:=True) =
True
With Selection.ParagraphFormat
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
End With
Loop
End With
Any help is appreciated.
Carlos
I have a document where some of the text with the "Caption" style have
the "Keep with Next" option checked. I want to loop through all the
Caption styles and uncheck the option.
I created this macro, but it is not really looping. It gets stuck on
the first occurrence and doesn't move to the next Caption style.
With ActiveDocument.Content.Find
.ClearFormatting
.Style = "Caption"
Do While .Execute(FindText:="", Forward:=True, Format:=True) =
True
With Selection.ParagraphFormat
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
End With
Loop
End With
Any help is appreciated.
Carlos