예제 #1
0
        public TOC(CT_SdtBlock block)
        {
            this.block = block;
            CT_SdtPr         sdtPr = block.AddNewSdtPr();
            CT_DecimalNumber id    = sdtPr.AddNewId();

            id.val = ("4844945");
            sdtPr.AddNewDocPartObj().AddNewDocPartGallery().val = ("Table of contents");
            CT_SdtEndPr sdtEndPr = block.AddNewSdtEndPr();
            CT_RPr      rPr      = sdtEndPr.AddNewRPr();
            CT_Fonts    fonts    = rPr.AddNewRFonts();

            fonts.asciiTheme    = (ST_Theme.minorHAnsi);
            fonts.eastAsiaTheme = (ST_Theme.minorHAnsi);
            fonts.hAnsiTheme    = (ST_Theme.minorHAnsi);
            fonts.cstheme       = (ST_Theme.minorBidi);
            rPr.AddNewB().val          = false;
            rPr.AddNewBCs().val        = false;
            rPr.AddNewColor().val      = ("auto");
            rPr.AddNewSz().val         = 24;
            rPr.AddNewSzCs().val       = 24;
            CT_SdtContentBlock content = block.AddNewSdtContent();
            CT_P p = content.AddNewP();

            byte[] b = Encoding.Unicode.GetBytes("00EF7E24");
            p.rsidR        = b;
            p.rsidRDefault = b;
            p.AddNewPPr().AddNewPStyle().val = ("TOCHeading");
            p.AddNewR().AddNewT().Value      = ("Table of Contents");
        }
예제 #2
0
        public TOC(CT_SdtBlock block)
        {
            this.block = block;
            CT_SdtPr ctSdtPr = block.AddNewSdtPr();

            ctSdtPr.AddNewId().val = "4844945";
            ctSdtPr.AddNewDocPartObj().AddNewDocPartGallery().val = "Table of contents";
            CT_RPr   ctRpr   = block.AddNewSdtEndPr().AddNewRPr();
            CT_Fonts ctFonts = ctRpr.AddNewRFonts();

            ctFonts.asciiTheme    = ST_Theme.minorHAnsi;
            ctFonts.eastAsiaTheme = ST_Theme.minorHAnsi;
            ctFonts.hAnsiTheme    = ST_Theme.minorHAnsi;
            ctFonts.cstheme       = ST_Theme.minorBidi;
            ctRpr.AddNewB().val     = ST_OnOff.off;
            ctRpr.AddNewBCs().val   = ST_OnOff.off;
            ctRpr.AddNewColor().val = "auto";
            ctRpr.AddNewSz().val    = 24UL;
            ctRpr.AddNewSzCs().val  = 24UL;
            CT_P ctP = block.AddNewSdtContent().AddNewP();

            byte[] bytes = Encoding.Unicode.GetBytes("00EF7E24");
            ctP.rsidR        = bytes;
            ctP.rsidRDefault = bytes;
            ctP.AddNewPPr().AddNewPStyle().val = "TOCHeading";
            ctP.AddNewR().AddNewT().Value      = "Table of Contents";
        }