Message-ID: <620585860.9495.1711692140868.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9494_1844442615.1711692140868" ------=_Part_9494_1844442615.1711692140868 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The CharacterRun class represe= nts a contiguous run of characters in the document, all of which have the s= ame formatting.
=20public sealed class CharacterRun : Element=20
Public NotInheritable Class CharacterRun =09=09Inherits Element=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.GetElemen= ts(Element.Type.CharacterRun) or Element.Children and check which elements are of t= ype Element.Type.CharacterRun.
=20The following sample demonstrates inserting a new character run into a d= ocument and retrieving the first character run from an existing document.= p>=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
'--- 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
Name | =20
Description | =20
---|---|
=20 | Returns a boolean that represents i=
f this character run was deleted with revision tracking on. | =20
=20 | 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). | =20
=20 | 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). | =20
=20 | Sets or returns a font for the CharacterRun. | =20
=20 | 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). | =20
=20 | 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). | =20
=20 | Returns a boolean that represents i=
f this character run was added while revision tracking was turned on. | =
=20
=20 | Returns a String that represents th=
e name of the author who modified the properties of this character run. | =20
=20 | Returns a DateTime object that repr=
esents the date and time the properties of this character run were modified=
. | =20
=20 | Sets or Returns a NamedStyle object that represents the Style of this character run= . | =20