F
FotoArt
hello everyone
I have a document which I need to break into sections(nextPage).
Im doing a search for 3 asterix marks and when found, insert the
sectionbreak.
I need to run the code until the end of document only once everytime it is
run.
Do I have to delete the existing section breaks first.
heres the code I have so far. It keeps looping nonstop
Sub letsDivide()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="***", Forward:=True, Wrap:=wdFindContinue,
MatchWildcards:=False _
) = True
Loop
End With
Selection.InsertBreak Type:=wdSectionBreakNextPage
End Sub
Any help will be appreciated.
thanx
ahmed
I have a document which I need to break into sections(nextPage).
Im doing a search for 3 asterix marks and when found, insert the
sectionbreak.
I need to run the code until the end of document only once everytime it is
run.
Do I have to delete the existing section breaks first.
heres the code I have so far. It keeps looping nonstop
Sub letsDivide()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="***", Forward:=True, Wrap:=wdFindContinue,
MatchWildcards:=False _
) = True
Loop
End With
Selection.InsertBreak Type:=wdSectionBreakNextPage
End Sub
Any help will be appreciated.
thanx
ahmed