Description
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.
C#
vb.net
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
.
Examples
C#
vb.net
Properties
Name |
Description |
---|---|
Returns an int that represents the absolute position in the document. |
Methods
Name |
Description |
---|---|
Creates and returns a Hyperlink at this Position. This hyperlink will have the specified url and displayed text. | |
Inserts and returns an InlineImage at the point represented by this Position. The image that is inserted is specified by a fileName string. | |
Inserts and returns an InlineImage at the point represented by this Position. The image that is inserted is specified by a Stream object. | |
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). | |
Creates and returns a MergeField at this Position. This merge field will have the specified name and contents. | |
Creates and returns an empty Paragraph at the point represented by this Position, formatted with the specified style. If this Position is in the middle of a paragraph the containing paragraph will be split. | |
Creates and returns an empty Section at the point represented by this Position. If this Position is in the middle of a section then the containing section will be split. | |
Creates and returns a Table at the point represented by this Position. The table will contain the specified number of rows and columns. | |
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 character run or part of the previous one. |