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 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#
Wiki Markup
{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|Position] object can be obtained from an [Element|Element].{excerpt}
{signature:C#}
 public sealed class Position
Signature
{signature}{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.

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

          WordApplication app = new WordApplication();
          Document doc = app.Create();
          Position pos = doc.GetPosition(0);
        
{code}
{code:vb.net
|title=vb.net
}

          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim pos As Position = doc.GetPosition(0)
        
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Properties

...

Name

...

Description

...

PositionValue

...

{code}

{example}
{properties}
||Name||Description||
|[PositionValue|Position.PositionValue]|{excerpt-include:Position.PositionValue

...

Methods

...

Name

...

Description

|nopanel=true}|
{methods}
||Name||Description||
|[InsertHyperlink(String, String)

...

|Position.InsertHyperlink(String, String)

...

]|{excerpt-include:Position.InsertHyperlink(String, String)

...

|nopanel

...

=true}|
|[InsertImage(String)

...

|Position.InsertImage(String)

...

]|{excerpt-include:Position.InsertImage(String)

...

|nopanel

...

=true}|
|[InsertImage(System.IO.Stream)

...

|Position.InsertImage(System.IO.Stream)

...

]|{excerpt-include:Position.InsertImage(System.IO.Stream)

...

|nopanel

...

=true}|
|[InsertList(Boolean)

...

|Position.InsertList(Boolean)

...

]|{excerpt-include:Position.InsertList(Boolean)

...

|nopanel

...

=true}|
|[InsertMergeField(String, String)

...

|Position.InsertMergeField(String, String)

...

]|{excerpt-include:Position.InsertMergeField(String, String)

...

|nopanel

...

=true}|
|[InsertParagraph(NamedStyle)

...

|Position.InsertParagraph(NamedStyle)

...

]|{excerpt-include:Position.InsertParagraph(NamedStyle)

...

|nopanel

...

=true}|
|[InsertSection()

...

|Position.InsertSection()

...

]|{excerpt-include:Position.InsertSection()

...

|nopanel

...

=true}|
|[InsertTable(Int32, Int32)

...

|Position.InsertTable(Int32, Int32)

...

]|{excerpt-include:Position.InsertTable(Int32, Int32)

...

|nopanel

...

=true}|
|[InsertText(String, Boolean)

...

|Position.InsertText(String, Boolean)

...

]|{excerpt-include:Position.InsertText(String, Boolean)

...

|nopanel

...

=true}|