Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

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.

Signature
C#
C#
 public sealed class ListEntry : Paragraph
{signature}{signature:
}
Signature
vb.net
vb.net
Public NotInheritable Class ListEntry
		Inherits Paragraph
{signature}
{remarks}The following sample gets the first [ListEntry|ListEntry] object of a [List|List].

To create a new list entry, use [
Remarks

The following sample gets the first ListEntry object of a 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

}}. {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#}

.

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
csharp
csharp
titleC#


          //--- 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:
Code Block
vb.net
|title=
vb.net
titlevb.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)
        
{code} {example} {properties} ||Name||Description|| |[BulletText|ListEntry.BulletText]|{excerpt-include:ListEntry.BulletText|nopanel=true}| |[LevelNum|ListEntry.LevelNum]|{excerpt-include:ListEntry.LevelNum|nopanel=true}| {methods} ||Name||Description|| |[RestartNumbering()|ListEntry.RestartNumbering()]|{excerpt-include:ListEntry.RestartNumbering()|nopanel=true}|
Properties

Name

Description

BulletText

Excerpt Include
ListEntry.BulletText
ListEntry.BulletText
nopaneltrue

LevelNum

Excerpt Include
ListEntry.LevelNum
ListEntry.LevelNum
nopaneltrue
Methods

Name

Description

RestartNumbering()

Excerpt Include
ListEntry.RestartNumbering()
ListEntry.RestartNumbering()
nopaneltrue