Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Represents a Word document.

Signature
C#
C#
 public sealed class Document : Element
Signature
vb.net
vb.net
Public NotInheritable Class Document
		Inherits Element
Remarks

To create a new document, use WordApplication.Create(). To open an existing document, use WordApplication.Open().

Note: Document inherits from Element and inherits a lot basic functionality from that class. Be sure to see the Element API docs when looking for specific functionality.

Example
Code Block
csharp
csharp
titleC#

          //--- Create a new Word document
          WordApplication app = new WordApplication();
          Document doc = app.Create();

          //--- Open an existing Word document
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
        
Code Block
vb.net
vb.net
titlevb.net

          '--- Create a new Word document
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()

          '--- Open an existing Word document
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
        
Properties

Name

Description

AutoformatType

Excerpt Include
Document.AutoformatType
Document.AutoformatType
nopaneltrue

CompatibilitySettings

Excerpt Include
Document.CompatibilitySettings
Document.CompatibilitySettings
nopaneltrue

ChangeTracking

Excerpt Include
Document.ChangeTracking
Document.ChangeTracking
nopaneltrue

DateCreated

Excerpt Include
Document.DateCreated
Document.DateCreated
nopaneltrue

DatePrinted

Excerpt Include
Document.DatePrinted
Document.DatePrinted
nopaneltrue

DateRevised

Excerpt Include
Document.DateRevised
Document.DateRevised
nopaneltrue

DefaultTabWidth

Excerpt Include
Document.DefaultTabWidth
Document.DefaultTabWidth
nopaneltrue

DocumentProperties

Excerpt Include
Document.DocumentProperties
Document.DocumentProperties
nopaneltrue

DocumentProtection

Excerpt Include
Document.DocumentProtection
Document.DocumentProtection
nopaneltrue

GutterPosition

Excerpt Include
Document.GutterPosition
Document.GutterPosition
nopaneltrue

HyphenSettings

Excerpt Include
Document.HyphenSettings
Document.HyphenSettings
nopaneltrue

MergeStylesFromTemplate

Excerpt Include
Document.MergeStylesFromTemplate
Document.MergeStylesFromTemplate
nopaneltrue

NumCharacters

Excerpt Include
Document.NumCharacters
Document.NumCharacters
nopaneltrue

NumPagesOnLastOpen

Excerpt Include
Document.NumPagesOnLastOpen
Document.NumPagesOnLastOpen
nopaneltrue

NumParagraphs

Excerpt Include
Document.NumParagraphs
Document.NumParagraphs
nopaneltrue

NumWords

Excerpt Include
Document.NumWords
Document.NumWords
nopaneltrue

PrintDataInFormFields

Excerpt Include
Document.PrintDataInFormFields
Document.PrintDataInFormFields
nopaneltrue

PrintFacingPages

Excerpt Include
Document.PrintFacingPages
Document.PrintFacingPages
nopaneltrue

SaveDataInFormField

Excerpt Include
Document.SaveDataInFormField
Document.SaveDataInFormField
nopaneltrue

Sections

Excerpt Include
Document.Sections
Document.Sections
nopaneltrue

Styles

Excerpt Include
Document.Styles
Document.Styles
nopaneltrue

UseWidowControl

Excerpt Include
Document.UseWidowControl
Document.UseWidowControl
nopaneltrue

ViewSettings

Excerpt Include
Document.ViewSettings
Document.ViewSettings
nopaneltrue

Watermark

Excerpt Include
Document.Watermark
Document.Watermark
nopaneltrue
Methods

Name

Description

Append(Document)

Excerpt Include
Document.Append(Document)
Document.Append(Document)
nopaneltrue

CreateDataImportProperties()

Excerpt Include
Document.CreateDataImportProperties()
Document.CreateDataImportProperties()
nopaneltrue

CreateFont()

Excerpt Include
Document.CreateFont()
Document.CreateFont()
nopaneltrue

CreateParagraphFormatting()

Excerpt Include
Document.CreateParagraphFormatting()
Document.CreateParagraphFormatting()
nopaneltrue

CreateTableFormatting()

Excerpt Include
Document.CreateTableFormatting()
Document.CreateTableFormatting()
nopaneltrue

GetBookmark(String)

Excerpt Include
Document.GetBookmark(String)
Document.GetBookmark(String)
nopaneltrue

GetVariable(String)

Excerpt Include
Document.GetVariable(String)
Document.GetVariable(String)
nopaneltrue

SetVariable(String, String)

Excerpt Include
Document.SetVariable(String, String)
Document.SetVariable(String, String)
nopaneltrue
Classes

Name

Description

Autoformat

Excerpt Include
Document.Autoformat
Document.Autoformat
nopaneltrue

Gutter

Excerpt Include
Document.Gutter
Document.Gutter
nopaneltrue