欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

C#創(chuàng)建Word項目標(biāo)號列表、多級編號列表-創(chuàng)新互聯(lián)

在Word文檔中,對于有多條并列的信息內(nèi)容或者段落時,我們常以添加項目標(biāo)號的形式來使文檔條理化,在閱讀時,文檔也更具美觀性。另外,對于在邏輯上存在一定層級結(jié)構(gòu)的內(nèi)容時,也可以通過多級編號列表來標(biāo)明文檔內(nèi)容的層次,并且,在修改、編輯文檔時也增加了靈活性。因此,在本篇文檔中,將介紹如何在C#中通過使用類庫Free Spire.Doc for .NET 來創(chuàng)建項目編號列表和多級編號列表的方法。
使用工具: Free Spire.Doc for .NET(社區(qū)版)
使用方法:在安裝該類庫后,在項目中引用Spire.Doc.dll即可(dll文件可在安裝路徑下的Bin文件夾中獲?。?/p>

專注于為中小企業(yè)提供成都網(wǎng)站制作、成都做網(wǎng)站、外貿(mào)營銷網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)合水免費做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了上1000+企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

一、 創(chuàng)建項目標(biāo)號列表

C#

using Spire.Doc;
using Spire.Doc.Documents;

namespace WordBullets
{
    class Program
    {
        static void Main(string[] args)
        {
            //初始化Document類實例,并添加section
            Document doc = new Document();
            Section section = doc.AddSection();

            //添加七個段落并分別添加文字
            Paragraph para1 = section.AddParagraph();
            para1.AppendText("國際政治類組織");
            Paragraph para2 = section.AddParagraph();
            para2.AppendText("歐洲聯(lián)盟(歐盟)");
            Paragraph para3 = section.AddParagraph();
            para3.AppendText("獨立國家聯(lián)合體(獨聯(lián)體)");
            Paragraph para4 = section.AddParagraph();
            para4.AppendText("上海合作組織");
            Paragraph para5 = section.AddParagraph();
            para5.AppendText("阿拉伯會議聯(lián)盟");
            Paragraph para6 = section.AddParagraph();
            para6.AppendText("國際生態(tài)安全合作組織");
            Paragraph para7 = section.AddParagraph();
            para7.AppendText("阿拉伯國家聯(lián)盟");

            //創(chuàng)建段落格式(字體)
            ParagraphStyle style = new ParagraphStyle(doc);
            style.Name = "fontStyle";
            style.CharacterFormat.FontName = "宋體";
            style.CharacterFormat.FontSize = 12f;
            doc.Styles.Add(style);

            //遍歷所有段落
            for (int i = 0; i < section.Paragraphs.Count; i++)
            {
                //從第二段開始應(yīng)用項目符號排列
                if (i != 0)
                {
                    section.Paragraphs[i].ApplyStyle(BuiltinStyle.ListBullet2);
                }

                //應(yīng)用字體格式到每一段
                section.Paragraphs[i].ApplyStyle("fontStyle");

            }
            //保存并打開文檔
            doc.SaveToFile("項目列表.docx", FileFormat.Docx2013);
            System.Diagnostics.Process.Start("項目列表.docx");
        }
    }
}

測試結(jié)果:
C# 創(chuàng)建Word項目標(biāo)號列表、多級編號列表

二、 創(chuàng)建多級編號列表

C#

using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;

namespace Multi_levelList_Doc
{
    class Program
    {
        static void Main(string[] args)
        {
            //新建Word文檔
            Document doc = new Document();
            Section section = doc.AddSection();

            //初始化ListStyle對象,指定List類型為數(shù)字列表并命名
            ListStyle listStyle = new ListStyle(doc, ListType.Numbered);
            listStyle.Name = "levelstyle";

            //設(shè)定一級列表模式為阿拉伯?dāng)?shù)字
            listStyle.Levels[0].PatternType = ListPatternType.Arabic;

            //設(shè)置二級列表數(shù)字前綴及模式
            listStyle.Levels[1].NumberPrefix = "\x0000.";
            listStyle.Levels[1].PatternType = ListPatternType.Arabic;

            //設(shè)置三級列表數(shù)字前綴及模式
            listStyle.Levels[2].NumberPrefix = "\x0000.\x0001.";
            listStyle.Levels[2].PatternType = ListPatternType.Arabic;

            //在ListStyles集合中添加新建的list style
            doc.ListStyles.Add(listStyle);

            //創(chuàng)建字體格式
            Spire.Doc.Formatting.CharacterFormat format = new Spire.Doc.Formatting.CharacterFormat(doc);
            format.FontName = "宋體";

            //添加段落,設(shè)置一級序列
            Paragraph paragraph = section.AddParagraph();
            TextRange tr = paragraph.AppendText("主要組織機(jī)構(gòu)");
            tr.ApplyCharacterFormat(format); //應(yīng)用字體格式
            paragraph.ApplyStyle(BuiltinStyle.Heading1); //應(yīng)用標(biāo)題1樣式
            paragraph.ListFormat.ApplyStyle("levelstyle"); //應(yīng)用列表樣式

            //添加段落,設(shè)置一級序列
            paragraph = section.AddParagraph();
            tr = paragraph.AppendText("主要職能");
            tr.ApplyCharacterFormat(format);
            paragraph.ApplyStyle(BuiltinStyle.Heading1);
            paragraph.ListFormat.ApplyStyle("levelstyle");

            //添加段落,設(shè)置二級序列
            paragraph = section.AddParagraph();
            tr = paragraph.AppendText("基本職能");
            tr.ApplyCharacterFormat(format);
            paragraph.ApplyStyle(BuiltinStyle.Heading2);
            paragraph.ListFormat.ListLevelNumber = 1; //設(shè)置等級為第二等級
            paragraph.ListFormat.ApplyStyle("levelstyle");

            //添加段落,設(shè)置二級序列
            paragraph = section.AddParagraph();
            tr = paragraph.AppendText("5大職能");
            tr.ApplyCharacterFormat(format);
            paragraph.ApplyStyle(BuiltinStyle.Heading2);
            paragraph.ListFormat.ContinueListNumbering();
            paragraph.ListFormat.ApplyStyle("levelstyle");

            //添加段落,設(shè)置三級序列
            paragraph = section.AddParagraph();
            tr = paragraph.AppendText("管理職能 \n 組織職能 \n 協(xié)調(diào)職能 \n 調(diào)節(jié)職能 \n 提供職能");
            tr.ApplyCharacterFormat(format);
            paragraph.ApplyStyle(BuiltinStyle.Heading5);
            paragraph.ListFormat.ListLevelNumber = 2; //設(shè)置等級為第三等級
            paragraph.ListFormat.ApplyStyle("levelstyle");

            //添加段落,設(shè)置一級序列
            paragraph = section.AddParagraph();
            tr = paragraph.AppendText("基本原則");
            tr.ApplyCharacterFormat(format);
            paragraph.ApplyStyle(BuiltinStyle.Heading1);
            paragraph.ListFormat.ApplyStyle("levelstyle");

            //保存并打開文檔
            doc.SaveToFile("多級列表.docx", FileFormat.Docx);
            System.Diagnostics.Process.Start("多級列表.docx");
        }
    }
}

測試結(jié)果:
C# 創(chuàng)建Word項目標(biāo)號列表、多級編號列表

以上代碼供參考,歡迎轉(zhuǎn)載(轉(zhuǎn)載請注明出處)。
感謝閱讀!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

網(wǎng)站標(biāo)題:C#創(chuàng)建Word項目標(biāo)號列表、多級編號列表-創(chuàng)新互聯(lián)
鏈接地址:http://aaarwkj.com/article44/dijjhe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)企業(yè)網(wǎng)站制作、網(wǎng)站設(shè)計公司、網(wǎng)站制作、微信小程序移動網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)
国产传媒在线观看精品| 乱熟av一区二区三区| 中文字幕在线成人影院| 亚洲av日韩专区在线观看| 全国精品免费视频久久久| 亚洲女人天堂av在线| 激情毛片av在线免费看| 蜜桃av网站在线播放| 国内精日韩欧中文的话| 亚洲中文有码一区二区| 日本人妻内射一区二区| 超碰91人人在线青青草| 给我免费在线观看视频| 中文字幕不卡一区在线| 蜜臀av在线国产一区| 国产成人色污在线观看| 亚洲精品国产熟女高潮| 国产三级国产精品国产专播| 日韩欧美亚洲综合久久精品| 99久久久久国产精品免费| 中文字幕日韩欧美一区在线| 久久国产成人精品免费看| 日本在线免费高清观看| 亚洲一区二区三区色婷婷| 人人妻人人澡人人妻| 日本免费一区二区三个| 免费在线观看美女av| 精品少妇高潮蜜臀av| 91亚洲蜜桃内射后入在线观看| 欧美日韩国产另类一区二区| 精品国产不卡在线观看| 亚州中文字幕久久一区| 亚洲精品国产av一区二区三区| 国产亚洲中文久久网久久| 丰满熟女人妻中文字幕免费| 69久久精品费精品国产| 国产成人三级视频网站| 亚洲精品色婷婷一区二区| 色偷偷亚洲精品一区二区| 久久99久久久久久精品| 国产国产精品人在线观看|