Z
Zumwalt
What I am trying to do, is accurately place page breaks after certain
conditions.
The following only works at placing the break last, no matter how many
paragraphs come after it in the code:
No matter where I place this in the code, page breaks are added only at the
end of the entire document. So say for instance, I have 10 paragraphs, then
that code, that "should" mean that the page break happens "at that point",
then any proceeding paragraphs should start at the next page after the break.
Again, I have another 10 paragraphs, then that line of code, well, the first
10 paragraphs and the second 10 paragraphs are together and there are 2 blank
pages at the end.
I then tried the following:
This had utterly no effect of adding a page break either.
Does anyone know the correct syntax to insert a page break at a given point
witihn a range?
conditions.
The following only works at placing the break last, no matter how many
paragraphs come after it in the code:
Code:
object oPageBreak = Word.WdBreakType.wdPageBreak;
wrdRng[cvg] = aDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
wrdRng[cvg].InsertBreak(ref oPageBreak);
No matter where I place this in the code, page breaks are added only at the
end of the entire document. So say for instance, I have 10 paragraphs, then
that code, that "should" mean that the page break happens "at that point",
then any proceeding paragraphs should start at the next page after the break.
Again, I have another 10 paragraphs, then that line of code, well, the first
10 paragraphs and the second 10 paragraphs are together and there are 2 blank
pages at the end.
I then tried the following:
Code:
object oPageBreak = Word.WdBreakType.wdPageBreak;
oP[lineX] = aDoc.Content.Paragraphs.Add(ref missing);
oP[lineX].Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;
oP[lineX].Range.Font.Bold = 1;
oP[lineX].Range.Font.Underline = Word.WdUnderline.wdUnderlineSingle;
oP[lineX].Range.Text = "Prior Document Data";
oP[lineX].Range.InsertParagraphAfter();
oP[lineX].Range.InsertBreak(ref oPageBreak);
This had utterly no effect of adding a page break either.
Does anyone know the correct syntax to insert a page break at a given point
witihn a range?