Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

This class is used to represent an entry in a List inside a Word document. A list entry in Word is basically a numbered paragraph.

}}.


{remarks}
{example}
The following sample demonstrates how to create a new list entry at the end of a list as well as how to get the first list entry of an existing list.
{code:csharp|title=C#}

          //--- Create a new list with a new list entry
          WordApplication app = new WordApplication();
          Document doc = app.Create();
          List lst = doc.InsertListAfter(true);
          lst.AddEntry(0);
          lst.InsertTextAfter("First list entry.", false);

          //--- Get the first list entry of an existing list
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          ListEntry entry =
               (ListEntry)doc.GetElements(Element.Type.ListEntry)[0];
        
{code}
{code:vb.net
|title=vb.net
}

          '--- Create a new list with a new list entry
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim lst As List = doc.InsertListAfter(True)
          lst.AddEntry(0)
          lst.InsertTextAfter("First list entry.", False)

          '--- Get the first list entry of an existing list
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim entry As ListEntry = _
               doc.GetElements(Element.Type.ListEntry)(0)
        
Signature
C#C#
Wiki Markup
{description}
{excerpt}This class is used to represent an entry in a List inside a Word document. A list entry in Word is basically a numbered paragraph.{excerpt}
{signature:C#}
 public sealed class ListEntry : Paragraph
Signature
{signature}{signature:vb.net
vb.net
}
Public NotInheritable Class ListEntry
		Inherits Paragraph
Remarks

The following sample gets the first ListEntry object of a List.

To create a new list entry, use
{signature}
{remarks}The following sample gets the first [ListEntry|ListEntry] object of a [List|List].

To create a new list entry, use [List.AddEntry()|List.AddEntry(Int32)].  To get an existing list entry, use [Element.GetElements(Element.Type.ListEntry)|Element.GetElements(Element.Type)] to get all elements of type {{ListEntry
.
Example

The following sample demonstrates how to create a new list entry at the end of a list as well as how to get the first list entry of an existing list.

Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Properties

...

Name

...

Description

...

BulletText

...

{code}

{example}
{properties}
||Name||Description||
|[BulletText|ListEntry.BulletText]|{excerpt-include:ListEntry.BulletText

...

LevelNum

|nopanel=true}|
|[LevelNum|ListEntry.LevelNum]|{excerpt-include

...

:ListEntry.LevelNum

...

Methods

...

Name

...

Description

...

RestartNumbering()

...

|nopanel=true}|
{methods}
||Name||Description||
|[RestartNumbering()|ListEntry.RestartNumbering()

...

]|{excerpt-include:ListEntry.RestartNumbering()

...

|nopanel

...

=true}|