using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Docs.Word; namespace ParagraphLists { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { // Creates a new instance of Document class and reads a .doc file into this structure Document Doc = new Document(); Doc.ReadDoc(@"..\..\Data\WordList.doc"); // For all nodes in this document... for (int i = 0; i < Doc.Sections[0].Nodes.Count; i++) { // if this node is a paragraph... if (Doc.Sections[0].Nodes[i].Type == NodeType.Paragraph) { // Gets list properties ListStyle tList = ((Paragraph)Doc.Sections[0].Nodes[i]).Style.List; // ...and if the paragraph is in a list... if (tList.isInList == true) { // Write its list properties TextBox.Text += "Paragraph " + (i+1) + ":" + "\r\n"; TextBox.Text += "- List-ID :" + tList.ID + "\r\n"; TextBox.Text += "- List level :" + tList.Level + "\r\n"; TextBox.Text += "- Bullet-style :" + tList.fBullets + "\r\n\r\n"; } } } } } }