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 a cursor position in the document. It sits between two characters and its position is represented as the index of the character it sits behind. A Position object can be obtained from an Element.

Signature
C#
C#
 public sealed class Position
Signature
vb.net
vb.net
Public NotInheritable Class Position
Remarks

You cannot create a new Position object using the new keyword. You must get a Position object using the GetPosition() method of the Element class (or the Document class, which inherits from Element ). This method takes a parameter that represents the relative offset from the start of this Element to point at which to get the Position.

The following sample gets a Position object from the start of a Document.

Example
Code Block
csharp
csharp
titleC#

          WordApplication app = new WordApplication();
          Document doc = app.Create();
          Position pos = doc.GetPosition(0);
        
Code Block
vb.net
vb.net
titlevb.net

          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim pos As Position = doc.GetPosition(0)
        
Properties

Name

Description

PositionValue

Excerpt Include
Position.PositionValue
Position.PositionValue
nopaneltrue
Methods

Name

Description

InsertHyperlink(String, String)

Excerpt Include
Position.InsertHyperlink(String, String)
Position.InsertHyperlink(String, String)
nopaneltrue

InsertImage(String)

Excerpt Include
Position.InsertImage(String)
Position.InsertImage(String)
nopaneltrue

InsertImage(System.IO.Stream)

Excerpt Include
Position.InsertImage(System.IO.Stream)
Position.InsertImage(System.IO.Stream)
nopaneltrue

InsertList(Boolean)

Excerpt Include
Position.InsertList(Boolean)
Position.InsertList(Boolean)
nopaneltrue

InsertMergeField(String, String)

Excerpt Include
Position.InsertMergeField(String, String)
Position.InsertMergeField(String, String)
nopaneltrue

InsertParagraph(NamedStyle)

Excerpt Include
Position.InsertParagraph(NamedStyle)
Position.InsertParagraph(NamedStyle)
nopaneltrue

InsertSection()

Excerpt Include
Position.InsertSection()
Position.InsertSection()
nopaneltrue

InsertTable(Int32, Int32)

Excerpt Include
Position.InsertTable(Int32, Int32)
Position.InsertTable(Int32, Int32)
nopaneltrue

InsertText(String, Boolean)

Excerpt Include
Position.InsertText(String, Boolean)
Position.InsertText(String, Boolean)
nopaneltrue