Hi Bill Cooter,
Is this what you want? I am not that sure.
Code:
object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\\endofdoc";
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
Word.Range wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
object oCollapseEnd = Word.WdCollapseDirection.wdCollapseEnd;
object oSection = Word.WdSectionStart.wdSectionNewPage;
wrdRng.Collapse(ref oCollapseEnd);
wrdRng.InsertBreak(ref oSection);
wrdRng.Collapse(ref oCollapseEnd);
wrdRng.InsertAfter("This is Page 2");
wrdRng.InsertParagraphAfter();
wrdRng.Collapse(ref oCollapseEnd);
wrdRng.InsertBreak(ref oSection);
wrdRng.Collapse(ref oCollapseEnd);
wrdRng.InsertAfter("This is Page 3");
wrdRng.InsertParagraphAfter();
Hope it helps. Correct me if i am wrong! Cheers.
--
Regards,
Chua Wen Ching :)
"Bill Cooter" wrote:
I am attempting to insert an existing document into another existing
document. When I insert the section break where I want the file insertion to
take place, no matter what type of section break I use;
wdSectionBreakContinuous; wdSectionBreakOddPage; wdSectionBreakEvenPage; or
wdSectionBreakNextPage, incidently, the one that I want, it always results
in a continuous break.
It works great for all breaks other than Section breaks. It's only when
using a Next, Odd, or Even Section Break that the problem exists. I have
also tried using the integer values for the constants (2,3,4,5), but to no
avail.
Can anyone shed light on this item?
Thanks in advance,
--
Bill Cooter
bc*****@hotmail.com