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}{signature:
}
Signature
vb.net
vb.net
Public NotInheritable Class Position
{signature}
{remarks}You cannot create a new {{Position}} object using the {{new}} keyword. You must get a {{Position}} object using the [GetPosition()|Element.GetPosition(Int32)] method of the {{Element}} class \(or the [Document|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}}.

{remarks}
{example}{code:csharp|title=C#}
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} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}


          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim pos As Position = doc.GetPosition(0)
        
{code} {example} {properties} ||Name||Description|| |[PositionValue|Position.PositionValue]|{excerpt-include:Position.PositionValue|nopanel=true}| {methods} ||Name||Description|| |[InsertHyperlink(String, String)|
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)

...

nopanel

...

...

Excerpt Include
Position.InsertImage(String)

...

Position.InsertImage(String)

...

nopanel

...

...

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

...

Position.InsertImage(System.IO.Stream)

...

nopanel

...

...

Excerpt Include
Position.InsertList(Boolean)

...

Position.InsertList(Boolean)

...

nopanel

...

...

...

Excerpt Include
Position.InsertMergeField(String,

...

String)

...

Position.InsertMergeField(String,

...

String)

...

nopanel

...

...

Excerpt Include
Position.InsertParagraph(NamedStyle)

...

Position.InsertParagraph(NamedStyle)

...

nopanel

...

...

Excerpt Include
Position.InsertSection()

...

Position.InsertSection()

...

nopanel

...

...

...

Excerpt Include
Position.InsertTable(Int32,

...

Int32)

...

Position.InsertTable(Int32,

...

Int32)

...

nopanel

...

...

...

Excerpt Include
Position.InsertText(String,

...

Boolean)

...

Position.InsertText(String,

...

Boolean)

...

nopanel

...

true

...