Message-ID: <1909791386.2203.1710822262463.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2202_593236680.1710822262448" ------=_Part_2202_593236680.1710822262448 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Position

Position

Description

=20

This class is used to represent a cursor position in the document. It si= ts between two characters and its position is represented as the index of t= he character it sits behind. A Position object can be obtained from an Element<= /a>.

=20
C#
=20
 public sealed class Position
=20
=20
vb.net
=20
Public NotInheritable Class Position
=20
=20

Remarks

=20

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 rela= tive offset from the start of this Element to point at which to get the Pos= ition.

=20

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

=20

Examples

=20
C#
=20

          WordApplication app =3D new WordApplication();
          Document doc =3D app.Create();
          Position pos =3D doc.GetPosition(0);
        
=20
=20
vb.net
=20

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

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

PositionValue

Returns an int that represents the = absolute position in the document.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

InsertHyperlink(String, String)

Creates and returns a Hyperlink at this Position. This hyperlink will have the speci= fied url and displayed text.

InsertImage(String)

Inserts and returns an InlineImage at the point represented by this Position. The = image that is inserted is specified by a fileName string.

InsertImage(System.IO.Stream)

Inserts and returns an InlineImage at the point represented by this Position. The = image that is inserted is specified by a Stream object.

InsertList(Boolean)

Creates and returns an empty List at the point represented by this Position. By passing a= boolean, it can be a numbered list (true) or a bulleted list (false).

InsertMergeField(String, String)

Creates and returns a MergeField at this Position. This merge field will have the s= pecified name and contents.

InsertParagraph(NamedStyle)

Creates and returns an empty Paragraph at the point represented by this Position, fo= rmatted with the specified style. If this Position is in the middle of a pa= ragraph the containing paragraph will be split.

InsertSection()

Creates and returns an empty Section at the point represented by this Position. If thi= s Position is in the middle of a section then the containing section will b= e split.

InsertTable(Int32, Int32)

Creates and returns a Table at the point represented by this Position. The table will co= ntain the specified number of rows and columns.

InsertText(String, Boolean)

Creates and returns a CharacterRun at the point represented by this Position. The= text to be inserted is specified as well as whether this should be a new c= haracter run or part of the previous one.
------=_Part_2202_593236680.1710822262448--