插入分页符

时间:2010-10-19 04:53:04
【文件属性】:

文件名称:插入分页符

文件大小:538B

文件格式:TXT

更新时间:2010-10-19 04:53:04

插入分页符

先定位到要分页的位置,再调用
ActiveWindow.Selection.InsertBreak(wdPageBreak)

分页
app.Selection.ParagraphFormat.Alignment=Word.WdParagraphAlignment.wdAlignParagraphCenter;//(对齐)

object insertBreak=null;

insertBreak=0;

app.Selection.InsertBreak(ref insertBreak);//插入分页符

//插入分页符
app.Selection.ParagraphFormat.Alignment=Word.WdParagraphAlignment.wdAlignParagraphCenter;//(对齐)

object insertBreak=null;
insertBreak=0;
app.Selection.InsertBreak(ref insertBreak);//插入分页符

http://blog.csdn.net/ranlianjie/archive/2007/08/30/1765817.aspx
通过段落控制插入
object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\endofdoc"; /**//* endofdoc is a predefined bookmark */

//Start Word and create a new document.
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);

//Insert a paragraph at the beginning of the document.
Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara1.Range.Text = "Heading 1";
oPara1.Range.Font.Bold = 1;
oPara1.Format.SpaceAfter = 24; //24 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter();


网友评论

  • 看来自己水品太差 没看明白