Message-ID: <1247688579.8987.1711670837634.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8986_539788101.1711670837634" ------=_Part_8986_539788101.1711670837634 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html List

List

Description

=20

This class is used to represent a list in a Word document. Lists are par= t of the BlockElement objects of an Element. Using this class, Lists can be read and written. Lists cont= ain list entries, which are basically paragraphs with additional features.<= /p>=20

C#
=20
 public sealed class List : Element
=20
=20
vb.net
=20
Public NotInheritable Class List
=09=09Inherits Element
=20
=20

Remarks

To create a new list, use=20 Element= .InsertListBefore() or=20 Element= .InsertListAfter(). To get an existing list, use=20 Element= .GetElements(Element.Type).=20

Examples

=20

The following sample demonstrates how to create a new list at the end of= a document as well as how to get the first list of a document.

=20
C#
=20

          //--- Insert a numbered list at the end of a new document with on=
e entry
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Create();
          List lst =3D doc.InsertListAfter(true);
          lst.AddEntry(0);
          lst.InsertTextAfter("First list entry.", false);

          //--- Get the first list of an existing document
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Open(@"C:\sample.doc");
          List lst =3D doc.GetElements(Element.Type.List)[0];
        
=20
=20
vb.net
=20

          '--- Insert a numbered list at the end of a new document with one=
 entry
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Create()
          Dim lst As List =3D doc.InsertListAfter(True)
          lst.AddEntry(0)
          lst.InsertTextAfter("First list entry.", False)

          '--- Get the first list of an existing document
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Open("C:\sample.doc")
          Dim lst As List =3D doc.GetElements(Element.Type.List)(0)
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

NumE= ntries

Returns an int representing the num= ber of contiguous entries in this lst.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

AddEntry(Int32)

Returns a Lis= tEntry object representing an empty list entry added to the end of the = list, which is indented to the level specified. Lev= el can be between 0 and 8 (9 levels total).

GetEntry(Int32)

Returns a Lis= tEntry object representing the entry at a specified index. The index of= list entries starts at 0.

GetLevel(Int32)

Returns a Lis= tLevel object representing a particular level for this lst. The levels = start at 0 and end at 8 (9 levels total).

InsertEntry(Int32, Int32)

Returns a Lis= tEntry object representing an empty list entry that is inserted at the = given index, which is indented to the level specified. index and level start at 0.= The maximum level is 8 (9 levels total).
------=_Part_8986_539788101.1711670837634--