I am trying to insert a section break before a certain piece of text. I
need to be able to print the first page of a bill to one tray, and the rest
to another tray. I have been told taht is accomplished by page/section
breaks in different points. Here is the code that i am having the problem
with:
I haven't been able to get it totally working. Here is the code i am using.
I can't seem to get the section break to work before i replace the data. the
line wiht the astrixes is the line giving me trouble
With Selection.Find
.Text = "
________________________________________________________________________________________________" & "^l" & " APR 1 - 2005 "
******* .Replacement.Text = Selection.InsertBreak & "^&"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAl
To insert a next page section break at the location of the cursor, use
Selection.InsertBreak wdSectionBreakNextPage
To insert a next page section break at the end of the first page of a
document, use
Selection.HomeKey wdStory
Selection.Bookmarks("\page").Range.Select
Selection.Collapse wdCollapseEnd
Selection.InsertBreak wdSectionBreakNextPage

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I am trying to insert a section break before a certain piece of text. I
> need to be able to print the first page of a bill to one tray, and the
[quoted text clipped - 25 lines]
> Selection.Find.Execute
> Selection.Find.Execute Replace:=wdReplaceAl