Message-ID: <567624601.2499.1710841153256.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2498_743545842.1710841153256" ------=_Part_2498_743545842.1710841153256 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Represents a Word document.
=20public sealed class Document : Element=20
Public NotInheritable Class Document =09=09Inherits Element=20
To create a new document, use WordApplication.Create(). To open an existi= ng document, use WordApplication.Open().
=20Note: Document in= herits from Element a= nd inherits a lot basic functionality from that class. Be sure to see the <= code>Element API docs when looking for specific functionality.
= =20//--- Create a new Word document WordApplication app =3D new WordApplication(); Document doc =3D app.Create(); //--- Open an existing Word document WordApplication app =3D new WordApplication(); Document doc =3D app.Open(@"C:\sample.doc");=20
'--- Create a new Word document Dim app As New WordApplication() Dim doc As Document =3D app.Create() '--- Open an existing Word document Dim app As New WordApplication() Dim doc As Document =3D app.Open("C:\sample.doc")=20
Name | =20
Description | =20
---|---|
=20 | Sets or returns a Document.Autoformat object representing autoformat type = for this document. Possible values: Normal, Letter, Email. | =20
=20 | Returns a CompatibilitySettings object that can be used to get and set v= arious settings that help Word display documents that were imported from ea= rlier versions and competing products. | =20
=20 | Returns a WordChangeTracking object that can be used to get and set the cha= nge tracking settings for this Document= a>. | =20
=20 | Returns a DateTime object represent=
ing the date this document was created. | =20
=20 | Returns a DateTime object represent=
ing the date this document was last printed using Word. | =20
=20 | Returns a DateTime object represent=
ing the date this document was last revised. | =20
=20 | Sets or returns an int representing=
the default tab width for this Document<=
/a>. The value that is returned is in twips. One twip =3D (1/20 pt) or ( 1/=
1440 in). | =20
=20 | Returns a Styles object that represents the properties of this document. | = =20
=20 | Returns a DocumentProtection object that can be used to get and set the pro= tection settings that Word will apply to this document. (Only applicable to= Word 2000 or above documents.) | =20
=20 | Sets or returns a Document.Gutter object representing the gutter position in t= his document when it is opened in Word. If you have set up your document wi= th facing pages or two pages per sheet (by using Mirror margins, Book fold,= or 2 pages per sheet), then this option is not available. Possible values:= Side, Top. | =20
=20 | Returns a WordHyphenSettings object that can be used to get and set the hyp= henation settings for this Document.<= /td>=20 |
=20 | Sets or returns a boolean represent=
ing if Word will update the styles in the current document to match the sty=
les in the attached Word template (i.e. Normal.dot) each time you open the =
document in Word. This should be set to true when you want to =
ensure that your document contains up-to-date style formatting. | =20
=20 | Returns an int representing the num=
ber of characters in this document. | =20
=20 | Returns an int representing the num=
ber of pages this document had when it was last opened in Word. | =20
=20 | Returns an int representing the num=
ber of paragraphs in this document. | =20
=20 | Returns an int representing the num=
ber of words in this document. | =20
=20 | Sets or returns a boolean represent=
ing if Word will only print the data inside a form field in this document. =
This is typically used to print the data entered into an online form withou=
t printing the online form. | =20
=20 | Sets or returns a boolean represent=
ing if the headers and footers should be different for odd and even pages, =
such as when the pages in this document will be mirrored. When set to true , it creates one header or footer for even-numbered pages and a=
different header or footer for odd-numbered pages. | =20
=20 | Sets or returns a boolean represent=
ing if Word will save only the data entered into a form field (instead of t=
he field itself) for this document. When this is set to true , =
Word saves the data entered into an online form as a single, tab-delimited =
record so you can use it in a database. Word saves the file in Text Only fi=
le format. | =20
=20 | Returns an array of Section objects that represents all the sections in this Document.= | =20
=20 | Returns a Styles object that represents the Styles embedded in this document.<= /td>=20 |
=20 | Sets or returns a boolean represent=
ing if widow control is in effect for this Document. | =20
=20 | Returns a WordViewSettings object that can be used to get and set various set= tings that pertain to how Word will display this document. | =20
=20 | Returns a Wat= ermark object representing an image or text that appears in the backgro= und of a printed document. | =20
Name | =20
Description | =20
---|---|
=20 | Appends an existing Document to the end of t= he current Document, separated by a next-page section break | =20
=20 | Returns a DataImportProperties object, which you can then use to set opti= ons for importing data into a table in a Word document. | =20
=20 | Returns a Font= object based on the font used by the Normal Style. You can then change the= properties of this font and use it elsewhere. | =20
=20 | Returns a ParagraphFormatting object based on the paragraph formatting use= d by the BodyText style. You can then change the properties of this font an= d use it elsewhere. | =20
=20 | Returns a TableFormatting object that represents the table formatting used by = the NormalTable style. | =20
=20 | Returns a Book= mark object that represents the bookmark in this document that has the = specified name. | =20
=20 | Returns the document variable specified by name.= | =20
=20 | Sets the value of the variable with the specifie=
d name. If the variable does not exist, setVariable creates a =
new variable. If the variable does exist, setVariable overwrit=
es the existing variable. | =20
Name | =20
Description | =20
---|---|
=20 | A D= ocument.Autoformat value specifies the type of AutoFormat settings to a= pply to a document. To select an AutoFormat type in Microsoft Word: | =20
=20 | A Docum= ent.Gutter value specifies the position of a document's gutter margin. = Gutter margins are used in documents that will be bound. A gutter margin is= an extra margin on the top or side of the page that ensures that the text = is not obscured when the document is bound. | =20