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

CharacterRun

Description

=20

The CharacterRun class represe= nts a contiguous run of characters in the document, all of which have the s= ame formatting.

=20
C#
=20
 public sealed class CharacterRun : Element
=20
=20
vb.net
=20
Public NotInheritable Class CharacterRun
=09=09Inherits Element
=20
=20

Remarks

=20

To insert a new character run into a document, use Element.InsertTextBefore() or Elem= ent.InsertTextAfter(). To get an existing character run, use Element.GetEleme= nts(Element.Type.CharacterRun) or Element.Children and check which elements are of = type Element.Type.CharacterRun.

=20

The following sample demonstrates inserting a new character run into a d= ocument and retrieving the first character run from an existing document.=20

Examples

=20
C#
=20

          //--- Insert a character run at the end of the document
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Create();
          CharacterRun run =3D doc.InsertTextAfter("Hello world!"=
, true);

          //--- Get the first character run of an existing document
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Open(@"C:\sample.doc");
          CharacterRun firstCharRun =3D
               (CharacterRun)doc.GetElements(Element.Type.CharacterRun)[0];
        
=20
=20
vb.net
=20

          '--- Insert a character run at the end of the document
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Create()
          Dim run As CharacterRun =3D doc.InsertTextAfter("Hello world=
!", True)

          '--- Get the first character run of an existing document
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Open("C:\sample.doc")
          Dim firstCharRun As CharacterRun =3D _
               doc.GetElements(Elements.Type.CharacterRun)(0)
        
=20
=20

Properties

=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 =20 =20 =20

Name

Description

Deleted

Returns a boolean that represents i= f this character run was deleted with revision tracking on.

DeletedBy

Returns a String that represents th= e name of the author who deleted the text in this character run (if revisio= n tracking was on when it was deleted -- Deleted returns true).

DeletedTime

Returns a DateTime object that repr= esents the date and time the text in this character run was deleted (if rev= ision tracking was on when it was deleted -- Deleted returns true).

Fo= nt

Sets or returns a font for the CharacterRun.

ModifiedBy

Returns a String that represents th= e name of the author who inserted the text in this character run (if revisi= on tracking was on when it was modified).

ModifiedTime

Returns a DateTime object that repr= esents the date and time the text in this character run was inserted (if re= vision tracking was on when it was modified).

New=

Returns a boolean that represents i= f this character run was added while revision tracking was turned on.

PropertiesChangedBy

Returns a String that represents th= e name of the author who modified the properties of this character run.=20

PropertiesChangedTime

Returns a DateTime object that repr= esents the date and time the properties of this character run were modified= .

S= tyle

Sets or Returns a NamedStyle object that represents the Style of this character run= .
------=_Part_8304_768863718.1711641165423--