0

公共静态无效AddNumeration(参考WordprocessingDocument finalDoc){

        IEnumerable<FooterPart> foo = finalDoc.MainDocumentPart.FooterParts;

        int count = 1;
        foreach (FooterPart fp in foo){

        Footer f = new Footer();

        ParagraphProperties paragraphProperties1 = new ParagraphProperties(new SectionProperties(new PageNumberType { Start = 1 }));
        paragraphProperties1.NumberingProperties = NumberingProperties
        paragraphProperties1.Justification = new Justification() { Val = JustificationValues.Right };
        Run run1 = new Run();
        Text text1 = new Text();

        text1.Text = count.ToString();
        count++;
        run1.Append(text1);
        Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };

        paragraph1.Append(paragraphProperties1);
        paragraph1.Append(run1);

        f.Append(paragraph1);

        fp.Footer = f;
     }


    }

此代码始终在每页的页脚部分显示数字 1。

4

1 回答 1

-1

在谷歌上搜索一下:https ://janewdaisy.wordpress.com/2012/03/01/insert-footer-in-word-document-cvb-net/

它应该做的工作

于 2015-07-29T17:01:32.250 回答