aspose.words module

The aspose.words module provides classes for generating, converting, modifying, rendering and printing Microsoft Word documents without utilizing Microsoft Word.

Aspose.Words library is written in Python and C#, and contains only safe managed code. Microsoft Word is not required in order to use Aspose.Words.

The classes in the aspose.words module borrow best practices from two well-known frameworks: Microsoft Word Automation and System.Xml. A document in Aspose.Words is represented by a tree of nodes, much like in XML DOM. Where possible, class, method and property names match those found in Microsoft Word Automation.

The main classes in this module are:

  • Document is the main class of the object model that represents a Microsoft Word document.

  • DocumentBuilder provides an easy way to insert content and formatting into a document.

  • Node is the base class for all nodes in the document.

  • CompositeNode is the base class for all nodes of the document that can contain other nodes, for example Paragraph, Section and Table.

Classes

ClassDescription
AbsolutePositionTabAn absolute position tab is a character which is used to advance the position on the current line of text when displaying this WordprocessingML content. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
BodyRepresents a container for the main text of a section. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
BookmarkRepresents a single bookmark. To learn more, visit the Working with Bookmarks documentation article.
BookmarkCollectionA collection of Bookmark objects that represent the bookmarks in the specified range. To learn more, visit the Working with Bookmarks documentation article.
BookmarkEndRepresents an end of a bookmark in a Word document. To learn more, visit the Working with Bookmarks documentation article.
BookmarkStartRepresents a start of a bookmark in a Word document. To learn more, visit the Working with Bookmarks documentation article.
BorderRepresents a border of an object. To learn more, visit the Programming with Documents documentation article.
BorderCollectionA collection of Border objects. To learn more, visit the Programming with Documents documentation article.
BuildVersionInfoProvides information about the current product name and version. To learn more, visit the Generator or Producer Name Included in Output Documents documentation article.
CleanupOptionsAllows to specify options for document cleaning. To learn more, visit the Clean Up a Document documentation article.
ComHelperProvides methods for COM clients to load a document into Aspose.Words.
CommentRepresents a container for text of a comment. To learn more, visit the Working with Comments documentation article.
CommentCollectionProvides typed access to a collection of Comment nodes. To learn more, visit the Working with Comments documentation article.
CommentRangeEndDenotes the end of a region of text that has a comment associated with it. To learn more, visit the Working with Comments documentation article.
CommentRangeStartDenotes the start of a region of text that has a comment associated with it. To learn more, visit the Working with Comments documentation article.
CompositeNodeBase class for nodes that can contain other nodes. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
ConditionalStyleRepresents special formatting applied to some area of a table with assigned table style. To learn more, visit the Working with Tables documentation article.
ConditionalStyleCollectionRepresents a collection of ConditionalStyle objects. To learn more, visit the Working with Tables documentation article.
ControlCharControl characters often encountered in documents. To learn more, visit the Working With Control Characters documentation article.
ConvertUtilProvides helper functions to convert between various measurement units. To learn more, visit the Convert Between Measurement Units documentation article.
DocumentRepresents a Word document. To learn more, visit the Working with Document documentation article.
DocumentBaseProvides the abstract base class for a main document and a glossary document of a Word document. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
DocumentBuilderProvides methods to insert text, images and other content, specify font, paragraph and section formatting. To learn more, visit the Document Builder Overview documentation article.
DocumentBuilderOptionsAllows to specify additional options for the document building process.
DocumentReaderPluginLoadExceptionThrown during document load, when the plugin required for reading the document format cannot be loaded.
DocumentVisitorBase class for custom document visitors. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
EditableRangeRepresents a single editable range. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
EditableRangeEndRepresents an end of an editable range in a Word document. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
EditableRangeStartRepresents a start of an editable range in a Word document. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
FileCorruptedExceptionThrown during document load, when the document appears to be corrupted and impossible to load. To learn more, visit the Programming with Documents documentation article.
FileFormatInfoContains data returned by FileFormatUtil document format detection methods. To learn more, visit the Detect File Format and Check Format Compatibility documentation article.
FileFormatUtilProvides utility methods for working with file formats, such as detecting file format or converting file extensions to/from file format enums. To learn more, visit the Detect File Format and Check Format Compatibility documentation article.
FontContains font attributes (font name, font size, color, and so on) for an object. To learn more, visit the Working with Fonts documentation article.
FrameFormatRepresents frame related formatting for a paragraph.
HeaderFooterRepresents a container for the header or footer text of a section. To learn more, visit the Working with Headers and Footers documentation article.
HeaderFooterCollectionProvides typed access to HeaderFooter nodes of a Section. To learn more, visit the Working with Headers and Footers documentation article.
HyphenationProvides methods for working with hyphenation dictionaries. These dictionaries prescribe where words of a specific language can be hyphenated. To learn more, visit the Working with Hyphenation documentation article.
IDocumentConverterPluginDefines an interface for external converter plugin.
IDocumentMergerPluginDefines an interface for external merger plugin that can merge Pdf documents.
IDocumentReaderPluginDefines an interface for external reader plugins that can read a file into a document.
IHyphenationCallbackImplemented by classes which can register hyphenation dictionaries.
INodeChangingCallbackImplement this interface if you want to receive notifications when nodes are inserted or removed in the document.
IRevisionCriteriaImplement this interface if you want to control when certain Revision should be accepted/rejected or not by the RevisionCollection.accept()/RevisionCollection.reject() methods.
IWarningCallbackImplement this interface if you want to have your own custom method called to capture loss of fidelity warnings that can occur during document loading or saving.
ImageWatermarkOptionsContains options that can be specified when adding a watermark with image. To learn more, visit the Working with Watermark documentation article.
ImportFormatOptionsAllows to specify various import options to format output. To learn more, visit the Specify Load Options documentation article.
IncorrectPasswordExceptionThrown if a document is encrypted with a password and the password specified when opening the document is incorrect or missing. To learn more, visit the Programming with Documents documentation article.
InlineBase class for inline-level nodes that can have character formatting associated with them, but cannot have child nodes of their own. To learn more, visit the Logical Levels of Nodes in a Document documentation article.
InlineStoryBase class for inline-level nodes that can contain paragraphs and tables. To learn more, visit the Logical Levels of Nodes in a Document documentation article.
InternableComplexAttrBase class for internable complex attribute. Internable complex attribute should notify parent collection when going to be changed. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
LicenseProvides methods to license the component. To learn more, visit the Licensing and Subscription documentation article.
MeteredProvides methods to set metered key.
NodeBase class for all nodes of a Word document. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
NodeChangingArgsProvides data for methods of the INodeChangingCallback interface.
NodeCollectionRepresents a collection of nodes of a specific type. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
NodeImporterAllows to efficiently perform repeated import of nodes from one document to another. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
NodeListRepresents a collection of nodes matching an XPath query executed using the CompositeNode.select_nodes() method. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
PageSetupRepresents the page setup properties of a section. To learn more, visit the Working with Sections documentation article.
ParagraphRepresents a paragraph of text. To learn more, visit the Working with Paragraphs documentation article.
ParagraphCollectionProvides typed access to a collection of Paragraph nodes. To learn more, visit the Working with Paragraphs documentation article.
ParagraphFormatRepresents all the formatting for a paragraph. To learn more, visit the Working with Paragraphs documentation article.
PhoneticGuideRepresents Phonetic Guide.
PlainTextDocumentAllows to extract plain-text representation of the document’s content. To learn more, visit the Working with Text Document documentation article.
RangeRepresents a contiguous area in a document. To learn more, visit the Working with Ranges documentation article.
RevisionRepresents a revision (tracked change) in a document node or style. Use Revision.revision_type to check the type of this revision. To learn more, visit the Track Changes in a Document documentation article.
RevisionCollectionA collection of Revision objects that represent revisions in the document. To learn more, visit the Track Changes in a Document documentation article.
RevisionGroupRepresents a group of sequential Revision objects. To learn more, visit the Track Changes in a Document documentation article.
RevisionGroupCollectionA collection of RevisionGroup objects that represent revision groups in the document. To learn more, visit the Track Changes in a Document documentation article.
RunRepresents a run of characters with the same font formatting. To learn more, visit the Programming with Documents documentation article.
RunCollectionProvides typed access to a collection of Run nodes. To learn more, visit the Programming with Documents documentation article.
SectionRepresents a single section in a document. To learn more, visit the Working with Sections documentation article.
SectionCollectionA collection of Section objects in the document. To learn more, visit the Working with Sections documentation article.
ShadingContains shading attributes for an object. To learn more, visit the Programming with Documents documentation article.
SignatureLineOptionsAllows to specify options for signature line being inserted. Used in DocumentBuilder. To learn more, visit the Work with Digital Signatures documentation article.
SpecialCharBase class for special characters in the document. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
StoryBase class for elements that contain block-level nodes Paragraph and Table. To learn more, visit the Logical Levels of Nodes in a Document documentation article.
StyleRepresents a single built-in or user-defined style. To learn more, visit the Working with Styles and Themes documentation article.
StyleCollectionA collection of Style objects that represent both the built-in and user-defined styles in a document. To learn more, visit the Working with Styles and Themes documentation article.
SubDocumentRepresents a SubDocument - which is a reference to an externally stored document. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
TabStopRepresents a single custom tab stop. The TabStop object is a member of the TabStopCollection collection. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
TabStopCollectionA collection of TabStop objects that represent custom tabs for a paragraph or a style. To learn more, visit the Aspose.Words Document Object Model (DOM) documentation article.
TableStyleRepresents a table style. To learn more, visit the Working with Tables documentation article.
TextColumnRepresents a single text column. TextColumn is a member of the TextColumnCollection collection. The TextColumn collection includes all the columns in a section of a document. To learn more, visit the Working with Sections documentation article.
TextColumnCollectionA collection of TextColumn objects that represent all the columns of text in a section of a document. To learn more, visit the Working with Sections documentation article.
TextWatermarkOptionsContains options that can be specified when adding a watermark with text. To learn more, visit the Working with Watermark documentation article.
UnsupportedFileFormatExceptionThrown during document load, when the document format is not recognized or not supported by Aspose.Words. To learn more, visit the Programming with Documents documentation article.
VariableCollectionA collection of document variables. To learn more, visit the Work with Document Properties documentation article.
WarningInfoContains information about a warning that Aspose.Words issued during document loading or saving. To learn more, visit the Programming with Documents documentation article.
WarningInfoCollectionRepresents a typed collection of WarningInfo objects. To learn more, visit the Programming with Documents documentation article.
WatermarkRepresents class to work with document watermark. To learn more, visit the Working with Watermark documentation article.

Enumerations

EnumerationDescription
BaselineAlignmentSpecifies fonts vertical position on a line.
BorderTypeSpecifies sides of a border. To learn more, visit the Programming with Documents documentation article.
BreakTypeSpecifies type of a break inside a document.
CalendarTypeSpecifies the type of a calendar.
ChapterPageSeparatorDefines the separator character that appears between the chapter and page number.
ConditionalStyleTypeRepresents possible table areas to which conditional formatting may be defined in a table style.
ContentDispositionEnumerates different ways of presenting the document at the client browser.
DropCapPositionSpecifies the position for a drop cap text.
EditorTypeSpecifies the set of possible aliases (or editing groups) which can be used as aliases to determine if the current user shall be allowed to edit a single range defined by an editable range within a document.
EmphasisMarkSpecifies possible types of emphasis mark.
HeaderFooterTypeIdentifies the type of header or footer found in a Word file.
HeightRuleSpecifies the rule for determining the height of an object.
HtmlInsertOptionsSpecifies options for the DocumentBuilder.insert_html() method.
ImportFormatModeSpecifies how formatting is merged when importing content from another document.
LineNumberRestartModeDetermines when automatic line numbering restarts.
LineSpacingRuleSpecifies line spacing values for a paragraph.
LineStyleSpecifies line style of a Border.
LoadFormatIndicates the format of the document that is to be loaded.
MarginsSpecifies preset margins.
MeasurementUnitsSpecifies the unit of measurement.
NodeChangingActionSpecifies the type of node change.
NodeTypeSpecifies the type of a Word document node.
NumberStyleSpecifies the number style for a list, footnotes and endnotes, page numbers.
OrientationSpecifies page orientation.
OutlineLevelSpecifies the outline level of a paragraph in the document.
PageBorderAppliesToSpecifies which pages the page border is printed on.
PageBorderDistanceFromSpecifies the positioning of the page border relative to the page margin.
PageVerticalAlignmentSpecifies vertical justification of text on each page.
PaperSizeSpecifies paper size.
ParagraphAlignmentSpecifies text alignment in a paragraph.
ProtectionTypeProtection type for a document.
RevisionTypeSpecifies the type of change being tracked in Revision.
RevisionsViewAllows to specify whether to work with the original or revised version of a document.
SaveFormatIndicates the format in which the document is saved.
SectionLayoutModeSpecifies the layout mode for a section allowing to define the document grid behavior.
SectionStartThe type of break at the beginning of the section.
StoryTypeText of a Word document is stored in stories. StoryType identifies a story.
StyleIdentifierLocale independent style identifier.
StyleTypeRepresents type of the style.
TabAlignmentSpecifies the alignment/type of a tab stop.
TabLeaderSpecifies the type of the leader line displayed under the tab character.
TextDmlEffectDml text effect for text runs.
TextEffectAnimation effect for text runs.
TextOrientationSpecifies orientation of text on a page, in a table cell or a text frame.
TextureIndexSpecifies shading texture.
UnderlineIndicates type of the underline applied to a font.
VisitorActionAllows the visitor to control the enumeration of nodes.
WarningSourceSpecifies the module that produces a warning during document loading or saving.
WarningTypeSpecifies the type of a warning that is issued by Aspose.Words during document loading or saving.
WatermarkLayoutDefines layout of the watermark relative to the watermark center.
WatermarkTypeSpecifies the watermark type.