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文件创建多层列表,具体可以参考下面的代码:
//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();