如何使用Essential DocIO控件在Word文件里创建多层列表

作者:控件中国网   出处:控件中国网   2016-05-10 14:58:28   阅读:6

Essential DocIO是一款.NET的类库,专门帮助开发人员创建、读取、写入和转换Word文件,支持Windows Forms, WPF, Silverlight, LightSwitch, ASP.NET, ASP.NET MVC, Windows Store, Windows Phone Silverlight 8 and 8.1, Windows Phone 8.1 and Xamarin 等平台下创建Word处理应用程序,兼容Microsoft Word 97-2003、Microsoft Word 2007、Microsoft Word 2010、Microsoft Word 2013、Microsoft Word 2016格式。该产品是包含在Essential Studio File Formats文档处理套包或者其他平台下的界面套包产品里,开发人员可以从控件中国网上了解和下载该产品的试用版。
 
这篇文章主要介绍怎么利用Essential DocIO控件为Word文件创建多层列表,具体可以参考下面的代码:
Word.png
//Writes default numbered list. 
 
paragraph = section.AddParagraph();
 
paragraph.AppendText("Level 0");
 
//Applies the default numbered list formats 
 
paragraph.ListFormat.ApplyDefNumberedStyle();
 
paragraph = section.AddParagraph();
 
paragraph.AppendText("Level 1");
 
//Specifies the list format to continue from last list
 
paragraph.ListFormat.ContinueListNumbering();
 
//Increments the list level
 
paragraph.ListFormat.IncreaseIndentLevel();
 
paragraph = section.AddParagraph();
 
paragraph.AppendText("Level 0");
 
paragraph.ListFormat.ContinueListNumbering();
 
//Decrements the list level
 
paragraph.ListFormat.DecreaseIndentLevel();
 
section.AddParagraph();
 
 
 
//Writes default bulleted list. 
 
paragraph = section.AddParagraph();
 
paragraph.AppendText("Level 0");
 
//Applies the default bulleted list formats
 
paragraph.ListFormat.ApplyDefBulletStyle();
 
paragraph = section.AddParagraph();
 
paragraph.AppendText("Level 1");
 
//Specifies the list format to continue from last list
 
paragraph.ListFormat.ContinueListNumbering();
 
//Increments the list level
 
paragraph.ListFormat.IncreaseIndentLevel();
 
paragraph = section.AddParagraph();
 
paragraph.AppendText("Level 0");
 
//Specifies the list format to continue from last list
 
paragraph.ListFormat.ContinueListNumbering();
 
//Decrements the list level
 
paragraph.ListFormat.DecreaseIndentLevel();
 
section.AddParagraph();
Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat