D
Dave Stone
I'm having problems inserting a page break in a document
I'm creating in an Access module. The document initially
is set up to contain "Test document"&vbcrlf&vbcrlf, and
using the debugger to display ActiveDocument.Range.Text
shows this very string. I then do:
ActiveDocument.Range.Collapse Direction:=wdCollapseEnd
ActiveDocument.Range.InsertBreak Type:=wdPageBreak
ActiveDocument.Range.InsertAfter vbCrLf & vbCrLf
& "This is 2nd page of text"
and after the 2nd line has executed, the range only
contains the page-break. The online help explicitly states
that "When you insert a page or column break, the range or
selection is replaced by the break. If you don't want to
replace the range or selection, use the Collapse method
before using the InsertBreak method." What is going wrong?
This is Office XP, by the way.
Dave
I'm creating in an Access module. The document initially
is set up to contain "Test document"&vbcrlf&vbcrlf, and
using the debugger to display ActiveDocument.Range.Text
shows this very string. I then do:
ActiveDocument.Range.Collapse Direction:=wdCollapseEnd
ActiveDocument.Range.InsertBreak Type:=wdPageBreak
ActiveDocument.Range.InsertAfter vbCrLf & vbCrLf
& "This is 2nd page of text"
and after the 2nd line has executed, the range only
contains the page-break. The online help explicitly states
that "When you insert a page or column break, the range or
selection is replaced by the break. If you don't want to
replace the range or selection, use the Collapse method
before using the InsertBreak method." What is going wrong?
This is Office XP, by the way.
Dave