Represents a Word document.
The Document is a central object in the Aspose.Words library.
To load an existing document in any of the LoadFormat formats, pass a file name or a stream into one of the Document constructors. To create a blank document, call the constructor without parameters.
Use one of the Save method overloads to save the document in any of the SaveFormat formats.
To draw document pages directly onto a Graphics object use RenderToScale() or RenderToSize() method.
To print the document, use one of the Print() methods.
MailMerge is the Aspose.Words's reporting engine that allows to populate reports designed in Microsoft Word with data from various data sources quickly and easily. The data can be from a or an array of values. MailMerge will go through the records found in the data source and insert them into mail merge fields in the document growing it as necessary.
Document stores document-wide information such as Styles, BuiltInDocumentProperties, CustomDocumentProperties, lists and macros. Most of these objects are accessible via the corresponding properties of the Document.
The Document is a root node of a tree that contains all other nodes of the document. The tree is a Composite design pattern and in many ways similar to XmlDocument. The content of the document can be manipulated freely programmatically:
Consider using DocumentBuilder that simplifies the task of programmatically creating or populating the document tree.
The Document can contain only Section objects.
In Microsoft Word, a valid document needs to have at least one section.
#include <Aspose.Words.Cpp/Document.h>
Public Member Functions | |
Document () | |
Creates a blank Word document. More... | |
Document (SharedPtr< Stream > stream) | |
Opens an existing document from a stream. Automatically detects the file format. More... | |
Document (SharedPtr< Stream > stream, SharedPtr< LoadOptions > loadOptions) | |
Opens an existing document from a stream. Allows to specify additional options such as an encryption password. More... | |
Document (String fileName) | |
Opens an existing document from a file. Automatically detects the file format. More... | |
Document (String fileName, SharedPtr< LoadOptions > loadOptions) | |
Opens an existing document from a file. Allows to specify additional options such as an encryption password. More... | |
bool | Accept (SharedPtr< DocumentVisitor > visitor) override |
Accepts a visitor. More... | |
void | AcceptAllRevisions () |
Accepts all tracked changes in the document. More... | |
void | Add (SharedPtr< Shape > watermark) override |
void | AppendDocument (SharedPtr< Document > srcDoc, ImportFormatMode importFormatMode) |
Appends the specified document to the end of this document. More... | |
void | AppendDocument (SharedPtr< Document > srcDoc, ImportFormatMode importFormatMode, SharedPtr< ImportFormatOptions > importFormatOptions) |
Appends the specified document to the end of this document. More... | |
void | Cleanup () |
Cleans unused styles and lists from the document. More... | |
void | Cleanup (SharedPtr< CleanupOptions > options) |
Cleans unused styles and lists from the document depending on given CleanupOptions. More... | |
SharedPtr< Document > | Clone () |
Performs a deep copy of the Document. More... | |
void | Compare (SharedPtr< Document > document, String author, DateTime dateTime) |
Compares this document with another document producing changes as number of edit and format revisions Revision. More... | |
void | Compare (SharedPtr< Document > document, String author, DateTime dateTime, SharedPtr< CompareOptions > options) |
Compares this document with another document producing changes as a number of edit and format revisions Revision. Allows to specify comparison options using CompareOptions. More... | |
void | CopyStylesFromTemplate (SharedPtr< Document > template_) |
Copies styles from the specified template to a document. More... | |
void | CopyStylesFromTemplate (String template_) |
Copies styles from the specified template to a document. More... | |
void | EnsureMinimum () |
If the document contains no sections, creates one section with one paragraph. More... | |
void | ExpandTableStylesToDirectFormatting () |
Converts formatting specified in table styles into direct formatting on tables in the document. More... | |
SharedPtr< Document > | ExtractPages (int32_t index, int32_t count) |
Returns the Document object representing specified range of pages. More... | |
SharedPtr< Shape > | Get () override |
String | get_AttachedTemplate () |
Gets or sets the full path of the template attached to the document. More... | |
bool | get_AutomaticallyUpdateStyles () |
Gets or sets a flag indicating whether the styles in the document are updated to match the styles in the attached template each time the document is opened in MS Word. More... | |
SharedPtr< BuiltInDocumentProperties > | get_BuiltInDocumentProperties () const |
Returns a collection that represents all the built-in document properties of the document. More... | |
SharedPtr< CompatibilityOptions > | get_CompatibilityOptions () |
Provides access to document compatibility options (that is, the user preferences entered on the Compatibility tab of the Options dialog in Word). More... | |
OoxmlCompliance | get_Compliance () |
Gets the OOXML compliance version determined from the loaded document content. Makes sense only for OOXML documents. More... | |
SharedPtr< CustomDocumentProperties > | get_CustomDocumentProperties () |
Returns a collection that represents all the custom document properties of the document. More... | |
SharedPtr< CustomXmlPartCollection > | get_CustomXmlParts () const |
Gets or sets the collection of Custom XML Data Storage Parts. More... | |
double | get_DefaultTabStop () |
Gets or sets the interval (in points) between the default tab stops. More... | |
SharedPtr< DigitalSignatureCollection > | get_DigitalSignatures () const |
Gets the collection of digital signatures for this document and their validation results. More... | |
SharedPtr< EndnoteOptions > | get_EndnoteOptions () |
Provides options that control numbering and positioning of endnotes in this document. More... | |
SharedPtr< FieldOptions > | get_FieldOptions () |
Gets a FieldOptions object that represents options to control field handling in the document. More... | |
SharedPtr< Section > | get_FirstSection () |
Gets the first section in the document. More... | |
SharedPtr< FontSettings > | get_FontSettings () const |
Gets or sets document font settings. More... | |
SharedPtr< FootnoteOptions > | get_FootnoteOptions () |
Provides options that control numbering and positioning of footnotes in this document. More... | |
SharedPtr< GlossaryDocument > | get_GlossaryDocument () const |
Gets or sets the glossary document within this document or template. A glossary document is a storage for AutoText, AutoCorrect and Building Block entries defined in a document. More... | |
bool | get_GrammarChecked () |
Returns true if the document has been checked for grammar. More... | |
bool | get_HasMacros () |
Returns true if the document has a VBA project (macros). More... | |
bool | get_HasRevisions () |
Returns true if the document has any tracked changes. More... | |
SharedPtr< HyphenationOptions > | get_HyphenationOptions () |
Provides access to document hyphenation options. More... | |
SharedPtr< Section > | get_LastSection () |
Gets the last section in the document. More... | |
SharedPtr< LayoutOptions > | get_LayoutOptions () const |
Gets a LayoutOptions object that represents options to control the layout process of this document. More... | |
SharedPtr< MailMerge > | get_MailMerge () |
Returns a MailMerge object that represents the mail merge functionality for the document. More... | |
SharedPtr< MailMergeSettings > | get_MailMergeSettings () |
Gets or sets the object that contains all of the mail merge information for a document. More... | |
NodeType | get_NodeType () const override |
Returns NodeType.Document. More... | |
String | get_OriginalFileName () const |
Gets the original file name of the document. More... | |
LoadFormat | get_OriginalLoadFormat () const |
Gets the format of the original document that was loaded into this object. More... | |
SharedPtr< CustomPartCollection > | get_PackageCustomParts () const |
Gets or sets the collection of custom parts (arbitrary content) that are linked to the OOXML package using "unknown relationships". More... | |
int32_t | get_PageCount () |
Gets the number of pages in the document as calculated by the most recent page layout operation. More... | |
ProtectionType | get_ProtectionType () |
Gets the currently active document protection type. More... | |
bool | get_RemovePersonalInformation () |
Gets or sets a flag indicating that Microsoft Word will remove all user information from comments, revisions and document properties upon saving the document. More... | |
SharedPtr< RevisionCollection > | get_Revisions () |
Gets a collection of revisions (tracked changes) that exist in this document. More... | |
RevisionsView | get_RevisionsView () const |
Gets or sets a value indicating whether to work with the original or revised version of a document. More... | |
SharedPtr< SectionCollection > | get_Sections () |
Returns a collection that represents all sections in the document. More... | |
bool | get_ShadeFormData () |
Specifies whether to turn on the gray shading on form fields. More... | |
bool | get_ShowGrammaticalErrors () |
Specifies whether to display grammar errors in this document. More... | |
bool | get_ShowSpellingErrors () |
Specifies whether to display spelling errors in this document. More... | |
bool | get_SpellingChecked () |
Returns true if the document has been checked for spelling. More... | |
SharedPtr< Theme > | get_Theme () |
Gets the Theme object for this document. More... | |
bool | get_TrackRevisions () |
True if changes are tracked when this document is edited in Microsoft Word. More... | |
SharedPtr< VariableCollection > | get_Variables () |
Returns the collection of variables added to a document or template. More... | |
SharedPtr< VbaProject > | get_VbaProject () const |
Gets or sets a VbaProject. More... | |
int32_t | get_VersionsCount () |
Gets the number of document versions that was stored in the DOC document. More... | |
SharedPtr< ViewOptions > | get_ViewOptions () |
Provides options to control how the document is displayed in Microsoft Word. More... | |
SharedPtr< Watermark > | get_Watermark () |
Provides access to the document watermark. More... | |
SharedPtr< TaskPaneCollection > | get_WebExtensionTaskPanes () const |
Returns a collection that represents a list of task pane add-ins. More... | |
SharedPtr< WriteProtection > | get_WriteProtection () |
Provides access to the document write protection options. More... | |
SharedPtr< PageInfo > | GetPageInfo (int32_t pageIndex) |
Gets the page size, orientation and other information about a page that might be useful for printing or rendering. More... | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
int32_t | JoinRunsWithSameFormatting () |
Joins runs with same formatting in all paragraphs of the document. More... | |
void | NormalizeFieldTypes () |
Changes field type values FieldType of FieldStart, FieldSeparator, FieldEnd in the whole document so that they correspond to the field types contained in the field codes. More... | |
void | Protect (ProtectionType type) |
Protects the document from changes without changing the existing password or assigns a random password. More... | |
void | Protect (ProtectionType type, String password) |
Protects the document from changes and optionally sets a protection password. More... | |
void | Remove () override |
Removes itself from the parent. More... | |
void | RemoveExternalSchemaReferences () |
Removes external XML schema references from this document. More... | |
void | RemoveMacros () |
Removes all macros (the VBA project) as well as toolbars and command customizations from the document. More... | |
SizeF | RenderToScale (int32_t pageIndex, SharedPtr< Graphics > graphics, float x, float y, float scale) |
Renders a document page into a object to a specified scale. More... | |
float | RenderToSize (int32_t pageIndex, SharedPtr< Graphics > graphics, float x, float y, float width, float height) |
Renders a document page into a object to a specified size. More... | |
SharedPtr< SaveOutputParameters > | Save (SharedPtr< Stream > stream, SaveFormat saveFormat) |
Saves the document to a stream using the specified format. More... | |
SharedPtr< SaveOutputParameters > | Save (SharedPtr< Stream > stream, SharedPtr< SaveOptions > saveOptions) |
Saves the document to a stream using the specified save options. More... | |
SharedPtr< SaveOutputParameters > | Save (String fileName) |
Saves the document to a file. Automatically determines the save format from the extension. More... | |
SharedPtr< SaveOutputParameters > | Save (String fileName, SaveFormat saveFormat) |
Saves the document to a file in the specified format. More... | |
SharedPtr< SaveOutputParameters > | Save (String fileName, SharedPtr< SaveOptions > saveOptions) |
Saves the document to a file using the specified save options. More... | |
void | set_AttachedTemplate (String value) |
Setter for get_AttachedTemplate. More... | |
void | set_AutomaticallyUpdateStyles (bool value) |
Setter for get_AutomaticallyUpdateStyles. More... | |
void | set_CustomXmlParts (SharedPtr< CustomXmlPartCollection > value) |
Setter for get_CustomXmlParts. More... | |
void | set_DefaultTabStop (double value) |
Setter for get_DefaultTabStop. More... | |
void | set_FontSettings (SharedPtr< FontSettings > value) |
Setter for get_FontSettings. More... | |
void | set_GlossaryDocument (SharedPtr< GlossaryDocument > value) |
Setter for get_GlossaryDocument. More... | |
void | set_GrammarChecked (bool value) |
Setter for get_GrammarChecked. More... | |
void | set_MailMergeSettings (SharedPtr< MailMergeSettings > value) |
Setter for get_MailMergeSettings. More... | |
void | set_PackageCustomParts (SharedPtr< CustomPartCollection > value) |
Setter for get_PackageCustomParts. More... | |
void | set_RemovePersonalInformation (bool value) |
Setter for get_RemovePersonalInformation. More... | |
void | set_RevisionsView (RevisionsView value) |
Setter for get_RevisionsView. More... | |
void | set_ShadeFormData (bool value) |
Setter for get_ShadeFormData. More... | |
void | set_ShowGrammaticalErrors (bool value) |
Setter for get_ShowGrammaticalErrors. More... | |
void | set_ShowSpellingErrors (bool value) |
Setter for get_ShowSpellingErrors. More... | |
void | set_SpellingChecked (bool value) |
Setter for get_SpellingChecked. More... | |
void | set_TrackRevisions (bool value) |
Setter for get_TrackRevisions. More... | |
void | set_VbaProject (SharedPtr< VbaProject > value) |
Setter for get_VbaProject. More... | |
void | StartTrackRevisions (String author) |
Starts automatically marking all further changes you make to the document programmatically as revision changes. More... | |
void | StartTrackRevisions (String author, DateTime dateTime) |
Starts automatically marking all further changes you make to the document programmatically as revision changes. More... | |
void | StopTrackRevisions () |
Stops automatic marking of document changes as revisions. More... | |
void | UnlinkFields () |
Unlinks fields in the whole document. More... | |
void | Unprotect () |
Removes protection from the document regardless of the password. More... | |
bool | Unprotect (String password) |
Removes protection from the document if a correct password is specified. More... | |
void | UpdateFields () |
Updates the values of fields in the whole document. More... | |
void | UpdateListLabels () |
Updates list labels for all list items in the document. More... | |
void | UpdatePageLayout () |
Rebuilds the page layout of the document. More... | |
void | UpdateTableLayout () |
Updates widths of cells and tables in the document according to their preferred widths and content. You do not need to call this method if the tables appear correct in the output document. More... | |
void | UpdateThumbnail () |
Updates Thumbnail of the document using default options. More... | |
void | UpdateThumbnail (SharedPtr< ThumbnailGeneratingOptions > options) |
Updates Thumbnail of the document according to the specified options. More... | |
void | UpdateWordCount () |
Updates word count properties of the document. More... | |
void | UpdateWordCount (bool updateLinesCount) |
Updates word count properties of the document, optionally updates Lines property. More... | |
![]() | |
SharedPtr< Shape > | get_BackgroundShape () const |
Gets or sets the background shape of the document. Can be null. More... | |
SharedPtr< DocumentBase > | get_Document () const override |
Gets the document to which this node belongs. More... | |
SharedPtr< FontInfoCollection > | get_FontInfos () const |
Provides access to properties of fonts used in this document. More... | |
SharedPtr< ListCollection > | get_Lists () const |
Provides access to the list formatting used in the document. More... | |
SharedPtr< INodeChangingCallback > | get_NodeChangingCallback () |
Called when a node is inserted or removed in the document. More... | |
Color | get_PageColor () |
Gets or sets the page color of the document. This property is a simpler version of BackgroundShape. More... | |
SharedPtr< IResourceLoadingCallback > | get_ResourceLoadingCallback () const |
Allows to control how external resources are loaded. More... | |
SharedPtr< StyleCollection > | get_Styles () const |
Returns a collection of styles defined in the document. More... | |
SharedPtr< IWarningCallback > | get_WarningCallback () const |
Called during various document processing procedures when an issue is detected that might result in data or formatting fidelity loss. More... | |
SharedPtr< Node > | ImportNode (SharedPtr< Node > srcNode, bool isImportChildren) |
Imports a node from another document to the current document. More... | |
SharedPtr< Node > | ImportNode (SharedPtr< Node > srcNode, bool isImportChildren, ImportFormatMode importFormatMode) |
Imports a node from another document to the current document with an option to control formatting. More... | |
void | set_BackgroundShape (SharedPtr< Shape > value) |
Setter for get_BackgroundShape. More... | |
void | set_NodeChangingCallback (SharedPtr< INodeChangingCallback > value) |
Setter for get_NodeChangingCallback. More... | |
void | set_PageColor (Color value) |
Setter for get_PageColor. More... | |
void | set_ResourceLoadingCallback (SharedPtr< IResourceLoadingCallback > value) |
Setter for get_ResourceLoadingCallback. More... | |
void | set_WarningCallback (SharedPtr< IWarningCallback > value) |
Setter for get_WarningCallback. More... | |
![]() | |
SharedPtr< Node > | AppendChild (SharedPtr< Node > newChild) |
Adds the specified node to the end of the list of child nodes for this node. More... | |
SharedPtr< NodeCollection > | get_ChildNodes () |
Gets all immediate child nodes of this node. More... | |
SharedPtr< CompositeNode > | get_Container () override |
int32_t | get_Count () |
Gets the number of immediate children of this node. More... | |
SharedPtr< Node > | get_FirstChild () const |
Gets the first child of the node. More... | |
bool | get_HasChildNodes () |
Returns true if this node has any child nodes. More... | |
bool | get_IsComposite () override |
Returns true as this node can have child nodes. More... | |
SharedPtr< Node > | get_LastChild () const |
Gets the last child of the node. More... | |
SharedPtr< Node > | GetChild (NodeType nodeType, int32_t index, bool isDeep) |
Returns an Nth child node that matches the specified type. More... | |
SharedPtr< NodeCollection > | GetChildNodes (NodeType nodeType, bool isDeep) |
Returns a live collection of child nodes that match the specified type. More... | |
SharedPtr< Node > | GetCurrentNode () override |
SharedPtr< IEnumerator< SharedPtr< Node > > > | GetEnumerator () override |
Provides support for the for each style iteration over the child nodes of this node. More... | |
SharedPtr< Node > | GetNextMatchingNode (SharedPtr< Node > curNode) override |
String | GetText () override |
Gets the text of this node and of all its children. More... | |
int32_t | IndexOf (SharedPtr< Node > child) |
Returns the index of the specified child node in the child node array. More... | |
SharedPtr< Node > | InsertAfter (SharedPtr< Node > newChild, SharedPtr< Node > refChild) |
Inserts the specified node immediately after the specified reference node. More... | |
SharedPtr< Node > | InsertBefore (SharedPtr< Node > newChild, SharedPtr< Node > refChild) |
Inserts the specified node immediately before the specified reference node. More... | |
SharedPtr< Node > | PrependChild (SharedPtr< Node > newChild) |
Adds the specified node to the beginning of the list of child nodes for this node. More... | |
void | RemoveAllChildren () |
Removes all the child nodes of the current node. More... | |
SharedPtr< Node > | RemoveChild (SharedPtr< Node > oldChild) |
Removes the specified child node. More... | |
void | RemoveSmartTags () |
Removes all SmartTag descendant nodes of the current node. More... | |
SharedPtr< NodeList > | SelectNodes (String xpath) |
Selects a list of nodes matching the XPath expression. More... | |
SharedPtr< Node > | SelectSingleNode (String xpath) |
Selects the first Node that matches the XPath expression. More... | |
![]() | |
SharedPtr< Node > | Clone (bool isCloneChildren) |
Creates a duplicate of the node. More... | |
int32_t | get_CustomNodeId () const |
Specifies custom node identifier. More... | |
SharedPtr< Node > | get_NextSibling () |
Gets the node immediately following this node. More... | |
SharedPtr< CompositeNode > | get_ParentNode () |
Gets the immediate parent of this node. More... | |
SharedPtr< Node > | get_PreviousSibling () |
Gets the node immediately preceding this node. More... | |
SharedPtr< Range > | get_Range () |
Returns a Range object that represents the portion of a document that is contained in this node. More... | |
SharedPtr< CompositeNode > | GetAncestor (NodeType ancestorType) |
Gets the first ancestor of the specified NodeType. More... | |
template<typename T > | |
T | GetAncestorOf () |
SharedPtr< Node > | NextPreOrder (SharedPtr< Node > rootNode) |
Gets next node according to the pre-order tree traversal algorithm. More... | |
SharedPtr< Node > | PreviousPreOrder (SharedPtr< Node > rootNode) |
Gets the previous node according to the pre-order tree traversal algorithm. More... | |
void | Remove () |
Removes itself from the parent. More... | |
void | set_CustomNodeId (int32_t value) |
Setter for get_CustomNodeId. More... | |
String | ToString (SaveFormat saveFormat) |
Exports the content of the node into a string in the specified format. More... | |
String | ToString (SharedPtr< SaveOptions > saveOptions) |
Exports the content of the node into a string using the specified save options. More... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
![]() | |
static const TypeInfo & | Type () |
![]() | |
static const TypeInfo & | Type () |
![]() | |
static String | NodeTypeToString (NodeType nodeType) |
A utility method that converts a node type enum value into a user friendly string. More... | |
static const TypeInfo & | Type () |
Aspose::Words::Document::Document | ( | ) |
Creates a blank Word document.
The document paper size is Letter by default. If you want to change page setup, use Section.PageSetup.
After creation, you can use DocumentBuilder to add document content easily.
Shows how to create and load documents.
Shows how to format a run of text using its font property.
Aspose::Words::Document::Document | ( | System::String | fileName | ) |
Opens an existing document from a file. Automatically detects the file format.
fileName | File name of the document to open. |
Aspose::Words::UnsupportedFileFormatException | The document format is not recognized or not supported. |
Aspose::Words::FileCorruptedException | The document appears to be corrupted and cannot be loaded. |
System::Exception | There is a problem with the document and it should be reported to Aspose.Words developers. |
System::IO::IOException | There is an input/output exception. |
Aspose::Words::IncorrectPasswordException | The document is encrypted and requires a password to open, but you supplied an incorrect password. |
System::ArgumentException | The name of the file cannot be null or empty string. |
Shows how to open a document and convert it to .PDF.
Aspose::Words::Document::Document | ( | System::String | fileName, |
System::SharedPtr< Aspose::Words::Loading::LoadOptions > | loadOptions | ||
) |
Opens an existing document from a file. Allows to specify additional options such as an encryption password.
fileName | File name of the document to open. |
loadOptions | Additional options to use when loading a document. Can be null. |
Aspose::Words::UnsupportedFileFormatException | The document format is not recognized or not supported. |
Aspose::Words::FileCorruptedException | The document appears to be corrupted and cannot be loaded. |
System::Exception | There is a problem with the document and it should be reported to Aspose.Words developers. |
System::IO::IOException | There is an input/output exception. |
Aspose::Words::IncorrectPasswordException | The document is encrypted and requires a password to open, but you supplied an incorrect password. |
System::ArgumentException | The name of the file cannot be null or empty string. |
Shows how to create and load documents.
Shows how to load an encrypted Microsoft Word document.
Aspose::Words::Document::Document | ( | System::SharedPtr< System::IO::Stream > | stream | ) |
Opens an existing document from a stream. Automatically detects the file format.
The document must be stored at the beginning of the stream. The stream must support random positioning.
stream | Stream where to load the document from. |
Aspose::Words::UnsupportedFileFormatException | The document format is not recognized or not supported. |
Aspose::Words::FileCorruptedException | The document appears to be corrupted and cannot be loaded. |
System::Exception | There is a problem with the document and it should be reported to Aspose.Words developers. |
System::IO::IOException | There is an input/output exception. |
Aspose::Words::IncorrectPasswordException | The document is encrypted and requires a password to open, but you supplied an incorrect password. |
System::ArgumentNullException | The stream cannot be null. |
System::NotSupportedException | The stream does not support reading or seeking. |
System::ObjectDisposedException | The stream is a disposed object. |
Shows how to load a document using a stream.
Shows how to load a document from a URL.
Aspose::Words::Document::Document | ( | System::SharedPtr< System::IO::Stream > | stream, |
System::SharedPtr< Aspose::Words::Loading::LoadOptions > | loadOptions | ||
) |
Opens an existing document from a stream. Allows to specify additional options such as an encryption password.
The document must be stored at the beginning of the stream. The stream must support random positioning.
stream | The stream where to load the document from. |
loadOptions | Additional options to use when loading a document. Can be null. |
Aspose::Words::UnsupportedFileFormatException | The document format is not recognized or not supported. |
Aspose::Words::FileCorruptedException | The document appears to be corrupted and cannot be loaded. |
System::Exception | There is a problem with the document and it should be reported to Aspose.Words developers. |
System::IO::IOException | There is an input/output exception. |
Aspose::Words::IncorrectPasswordException | The document is encrypted and requires a password to open, but you supplied an incorrect password. |
System::ArgumentNullException | The stream cannot be null. |
System::NotSupportedException | The stream does not support reading or seeking. |
System::ObjectDisposedException | The stream is a disposed object. |
Shows how to open an HTML document with images from a stream using a base URI.
Shows how save a web page as a .docx file.
Shows how to load an encrypted Microsoft Word document.
|
overridevirtual |
Accepts a visitor.
Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.
For more info see the Visitor design pattern.
visitor | The visitor that will visit the nodes. |
Shows how to use a document visitor to print a document's node structure.
Implements Aspose::Words::Node.
void Aspose::Words::Document::AcceptAllRevisions | ( | ) |
Accepts all tracked changes in the document.
Shows how to accept all tracking changes in the document.
|
override |
void Aspose::Words::Document::AppendDocument | ( | System::SharedPtr< Aspose::Words::Document > | srcDoc, |
Aspose::Words::ImportFormatMode | importFormatMode | ||
) |
Appends the specified document to the end of this document.
srcDoc | The document to append. |
importFormatMode | Specifies how to merge style formatting that clashes. |
Shows how to append a document to the end of another document.
Shows how to append all the documents in a folder to the end of a template document.
void Aspose::Words::Document::AppendDocument | ( | System::SharedPtr< Aspose::Words::Document > | srcDoc, |
Aspose::Words::ImportFormatMode | importFormatMode, | ||
System::SharedPtr< Aspose::Words::ImportFormatOptions > | importFormatOptions | ||
) |
Appends the specified document to the end of this document.
srcDoc | The document to append. |
importFormatMode | Specifies how to merge style formatting that clashes. |
importFormatOptions | Allows to specify options that affect formatting of a result document. |
Shows how to manage list style clashes while appending a document.
Shows how to manage list style clashes while inserting a document.
Shows how to manage list style clashes while appending a clone of a document to itself.
void Aspose::Words::Document::Cleanup | ( | ) |
Cleans unused styles and lists from the document.
Shows how to remove unused custom styles from a document.
void Aspose::Words::Document::Cleanup | ( | System::SharedPtr< Aspose::Words::CleanupOptions > | options | ) |
Cleans unused styles and lists from the document depending on given CleanupOptions.
Shows how to remove all unused custom styles from a document.
System::SharedPtr<Aspose::Words::Document> Aspose::Words::Document::Clone | ( | ) |
Performs a deep copy of the Document.
Shows how to deep clone a document.
void Aspose::Words::Document::Compare | ( | System::SharedPtr< Aspose::Words::Document > | document, |
System::String | author, | ||
System::DateTime | dateTime | ||
) |
Compares this document with another document producing changes as number of edit and format revisions Revision.
The following document nodes are not compared at the moment:
document | Document to compare. |
author | Initials of the author to use for revisions. |
dateTime | The date and time to use for revisions. |
Shows how to compare documents.
void Aspose::Words::Document::Compare | ( | System::SharedPtr< Aspose::Words::Document > | document, |
System::String | author, | ||
System::DateTime | dateTime, | ||
System::SharedPtr< Aspose::Words::Comparing::CompareOptions > | options | ||
) |
Compares this document with another document producing changes as a number of edit and format revisions Revision. Allows to specify comparison options using CompareOptions.
Shows how to filter specific types of document elements when making a comparison.
void Aspose::Words::Document::CopyStylesFromTemplate | ( | System::SharedPtr< Aspose::Words::Document > | template_ | ) |
Copies styles from the specified template to a document.
Shows how to copies styles from the template to a document via Document.
Shows how to copy styles from one document to another.
void Aspose::Words::Document::CopyStylesFromTemplate | ( | System::String | template_ | ) |
Copies styles from the specified template to a document.
Shows how to copy styles from one document to another.
void Aspose::Words::Document::EnsureMinimum | ( | ) |
If the document contains no sections, creates one section with one paragraph.
Shows how to ensure that a document contains the minimal set of nodes required for editing its contents.
void Aspose::Words::Document::ExpandTableStylesToDirectFormatting | ( | ) |
Converts formatting specified in table styles into direct formatting on tables in the document.
This method exists because this version of Aspose.Words provides only limited support for table styles (see below). This method might be useful when you load a DOCX or WordprocessingML document that contains tables formatted with table styles and you need to query formatting of tables, cells, paragraphs or text.
This version of Aspose.Words provides limited support for table styles as follows:
Shows how to apply the properties of a table's style directly to the table's elements.
System::SharedPtr<Aspose::Words::Document> Aspose::Words::Document::ExtractPages | ( | int32_t | index, |
int32_t | count | ||
) |
Returns the Document object representing specified range of pages.
index | The zero-based index of the first page to extract. |
count | Number of pages to be extracted. |
Shows how to get specified range of pages from the document.
|
override |
System::String Aspose::Words::Document::get_AttachedTemplate | ( | ) |
Gets or sets the full path of the template attached to the document.
Empty string means the document is attached to the Normal template.
System::ArgumentNullException | Throws if you attempt to set to a null value. |
Shows how to set a default template for documents that do not have attached templates.
bool Aspose::Words::Document::get_AutomaticallyUpdateStyles | ( | ) |
Gets or sets a flag indicating whether the styles in the document are updated to match the styles in the attached template each time the document is opened in MS Word.
Shows how to attach a template to a document.
Shows how to set a default template for documents that do not have attached templates.
System::SharedPtr<Aspose::Words::Properties::BuiltInDocumentProperties> Aspose::Words::Document::get_BuiltInDocumentProperties | ( | ) | const |
Returns a collection that represents all the built-in document properties of the document.
Shows how to work with built-in document properties.
System::SharedPtr<Aspose::Words::Settings::CompatibilityOptions> Aspose::Words::Document::get_CompatibilityOptions | ( | ) |
Provides access to document compatibility options (that is, the user preferences entered on the Compatibility tab of the Options dialog in Word).
Aspose::Words::Saving::OoxmlCompliance Aspose::Words::Document::get_Compliance | ( | ) |
Gets the OOXML compliance version determined from the loaded document content. Makes sense only for OOXML documents.
If you created a new blank document or load non OOXML document returns the Ecma376_2006 value.
Shows how to read a loaded document's Open Office XML compliance version.
System::SharedPtr<Aspose::Words::Properties::CustomDocumentProperties> Aspose::Words::Document::get_CustomDocumentProperties | ( | ) |
Returns a collection that represents all the custom document properties of the document.
Shows how to work with built-in document properties.
System::SharedPtr<Aspose::Words::Markup::CustomXmlPartCollection> Aspose::Words::Document::get_CustomXmlParts | ( | ) | const |
Gets or sets the collection of Custom XML Data Storage Parts.
Aspose.Words loads and saves Custom XML Parts into OOXML and DOC documents only.
This property cannot be null
.
Shows how to create a structured document tag with custom XML data.
double Aspose::Words::Document::get_DefaultTabStop | ( | ) |
Gets or sets the interval (in points) between the default tab stops.
Shows how to set a custom interval for tab stop positions.
System::SharedPtr<Aspose::Words::DigitalSignatures::DigitalSignatureCollection> Aspose::Words::Document::get_DigitalSignatures | ( | ) | const |
Gets the collection of digital signatures for this document and their validation results.
This collection contains digital signatures that were loaded from the original document. These digital signatures will not be saved when you save this Document object into a file or stream because saving or converting will produce a document that is different from the original and the original digital signatures will no longer be valid.
This collection is never null. If the document is not signed, it will contain zero elements.
Shows how to validate and display information about each signature in a document.
Shows how to sign documents with X.509 certificates.
System::SharedPtr<Aspose::Words::Notes::EndnoteOptions> Aspose::Words::Document::get_EndnoteOptions | ( | ) |
Provides options that control numbering and positioning of endnotes in this document.
Shows how to select a different place where the document collects and displays its endnotes.
Shows how to change the number style of footnote/endnote reference marks.
Shows how to restart footnote/endnote numbering at certain places in the document.
Shows how to set a number at which the document begins the footnote/endnote count.
System::SharedPtr<Aspose::Words::Fields::FieldOptions> Aspose::Words::Document::get_FieldOptions | ( | ) |
Gets a FieldOptions object that represents options to control field handling in the document.
System::SharedPtr<Aspose::Words::Section> Aspose::Words::Document::get_FirstSection | ( | ) |
Gets the first section in the document.
Shows how to replace text in a document's footer.
Shows how to create a new section with a document builder.
Shows how to iterate through the children of a composite node.
System::SharedPtr<Aspose::Words::Fonts::FontSettings> Aspose::Words::Document::get_FontSettings | ( | ) | const |
Gets or sets document font settings.
This property allows to specify font settings per document. If set to null, default static font settings DefaultInstance will be used.
The default value is null.
Shows how set font substitution rules.
System::SharedPtr<Aspose::Words::Notes::FootnoteOptions> Aspose::Words::Document::get_FootnoteOptions | ( | ) |
Provides options that control numbering and positioning of footnotes in this document.
Shows how to select a different place where the document collects and displays its footnotes.
Shows how to change the number style of footnote/endnote reference marks.
Shows how to restart footnote/endnote numbering at certain places in the document.
Shows how to set a number at which the document begins the footnote/endnote count.
System::SharedPtr<Aspose::Words::BuildingBlocks::GlossaryDocument> Aspose::Words::Document::get_GlossaryDocument | ( | ) | const |
Gets or sets the glossary document within this document or template. A glossary document is a storage for AutoText, AutoCorrect and Building Block entries defined in a document.
This property returns null
if the document does not have a glossary document.
You can add a glossary document to a document by creating a GlossaryDocument object and assigning to this property.
Shows how to add a custom building block to a document.
bool Aspose::Words::Document::get_GrammarChecked | ( | ) |
Returns true if the document has been checked for grammar.
Shows how to set spelling or grammar verifying.
bool Aspose::Words::Document::get_HasMacros | ( | ) |
Returns true if the document has a VBA project (macros).
Shows how to use MACROBUTTON fields to allow us to run a document's macros by clicking.
bool Aspose::Words::Document::get_HasRevisions | ( | ) |
Returns true if the document has any tracked changes.
Shows how to work with revisions in a document.
System::SharedPtr<Aspose::Words::Settings::HyphenationOptions> Aspose::Words::Document::get_HyphenationOptions | ( | ) |
Provides access to document hyphenation options.
Shows how to configure automatic hyphenation.
System::SharedPtr<Aspose::Words::Section> Aspose::Words::Document::get_LastSection | ( | ) |
Gets the last section in the document.
Shows how to create a new section with a document builder.
System::SharedPtr<Aspose::Words::Layout::LayoutOptions> Aspose::Words::Document::get_LayoutOptions | ( | ) | const |
Gets a LayoutOptions object that represents options to control the layout process of this document.
Shows how to alter the appearance of revisions in a rendered output document.
Shows how to hide text in a rendered output document.
Shows how to show paragraph marks in a rendered output document.
System::SharedPtr<Aspose::Words::MailMerging::MailMerge> Aspose::Words::Document::get_MailMerge | ( | ) |
Returns a MailMerge object that represents the mail merge functionality for the document.
System::SharedPtr<Aspose::Words::Settings::MailMergeSettings> Aspose::Words::Document::get_MailMergeSettings | ( | ) |
Gets or sets the object that contains all of the mail merge information for a document.
You can use this object to specify a mail merge data source for a document and this information (along with the available data fields) will appear in Microsoft Word when the user opens this document. Or you can use this object to query mail merge settings that the user has specified in Microsoft Word for this document.
This object is never null.
|
overridevirtual |
Returns NodeType.Document.
Shows how to traverse a composite node's tree of child nodes.
Implements Aspose::Words::Node.
System::String Aspose::Words::Document::get_OriginalFileName | ( | ) | const |
Gets the original file name of the document.
Returns null if the document was loaded from a stream or created blank.
Shows how to retrieve details of a document's load operation.
Shows how to use the FileFormatUtil methods to detect the format of a document.
Aspose::Words::LoadFormat Aspose::Words::Document::get_OriginalLoadFormat | ( | ) | const |
Gets the format of the original document that was loaded into this object.
If you created a new blank document, returns the Doc value.
Shows how to retrieve details of a document's load operation.
System::SharedPtr<Aspose::Words::Markup::CustomPartCollection> Aspose::Words::Document::get_PackageCustomParts | ( | ) | const |
Gets or sets the collection of custom parts (arbitrary content) that are linked to the OOXML package using "unknown relationships".
Do not confuse these custom parts with Custom XML Data. If you need to access Custom XML parts, use the CustomXmlParts property.
This collection contains OOXML parts whose parent is the OOXML package and they targets are of an "unknown relationship". For more information see CustomPart.
Aspose.Words loads and saves custom parts into OOXML documents only.
This property cannot be null
.
Shows how to access a document's arbitrary custom parts collection.
int32_t Aspose::Words::Document::get_PageCount | ( | ) |
Gets the number of pages in the document as calculated by the most recent page layout operation.
Shows how to count the number of pages in the document.
Aspose::Words::ProtectionType Aspose::Words::Document::get_ProtectionType | ( | ) |
Gets the currently active document protection type.
This property allows to retrieve the currently set document protection type. To change the document protection type use the Protect() and Unprotect methods.
When a document is protected, the user can make only limited changes, such as adding annotations, making revisions, or completing a form.
Note that document protection is different from write protection. Write protection is specified using the WriteProtection
Shows how to protect and unprotect a document.
bool Aspose::Words::Document::get_RemovePersonalInformation | ( | ) |
Gets or sets a flag indicating that Microsoft Word will remove all user information from comments, revisions and document properties upon saving the document.
Shows how to enable the removal of personal information during a manual save.
System::SharedPtr<Aspose::Words::RevisionCollection> Aspose::Words::Document::get_Revisions | ( | ) |
Gets a collection of revisions (tracked changes) that exist in this document.
The returned collection is a "live" collection, which means if you remove parts of a document that contain revisions, the deleted revisions will automatically disappear from this collection.
Shows how to work with revisions in a document.
Aspose::Words::RevisionsView Aspose::Words::Document::get_RevisionsView | ( | ) | const |
Gets or sets a value indicating whether to work with the original or revised version of a document.
Shows how to switch between the revised and the original view of a document.
System::SharedPtr<Aspose::Words::SectionCollection> Aspose::Words::Document::get_Sections | ( | ) |
Returns a collection that represents all sections in the document.
Shows how to specify how a new section separates itself from the previous.
Shows how to add and remove sections in a document.
bool Aspose::Words::Document::get_ShadeFormData | ( | ) |
Specifies whether to turn on the gray shading on form fields.
Shows how to apply gray shading to form fields.
bool Aspose::Words::Document::get_ShowGrammaticalErrors | ( | ) |
Specifies whether to display grammar errors in this document.
Shows how to show/hide errors in the document.
bool Aspose::Words::Document::get_ShowSpellingErrors | ( | ) |
Specifies whether to display spelling errors in this document.
Shows how to show/hide errors in the document.
bool Aspose::Words::Document::get_SpellingChecked | ( | ) |
Returns true if the document has been checked for spelling.
Shows how to set spelling or grammar verifying.
System::SharedPtr<Aspose::Words::Themes::Theme> Aspose::Words::Document::get_Theme | ( | ) |
Gets the Theme object for this document.
Shows how to set custom colors and fonts for themes.
bool Aspose::Words::Document::get_TrackRevisions | ( | ) |
True if changes are tracked when this document is edited in Microsoft Word.
Setting this option only instructs Microsoft Word whether the track changes is turned on or off. This property has no effect on changes to the document that you make programmatically via Aspose.Words.
If you want to automatically track changes as they are made programmatically by Aspose.Words to this document use the StartTrackRevisions() method.
Shows how to work with revisions in a document.
System::SharedPtr<Aspose::Words::VariableCollection> Aspose::Words::Document::get_Variables | ( | ) |
Returns the collection of variables added to a document or template.
Shows how to work with a document's variable collection.
System::SharedPtr<Aspose::Words::Vba::VbaProject> Aspose::Words::Document::get_VbaProject | ( | ) | const |
Gets or sets a VbaProject.
Shows how to access a document's VBA project information.
int32_t Aspose::Words::Document::get_VersionsCount | ( | ) |
Gets the number of document versions that was stored in the DOC document.
Versions in Microsoft Word are accessed via the File/Versions menu. Microsoft Word supports versions only for DOC files.
This property allows to detect if there were document versions stored in this document before it was opened in Aspose.Words. Aspose.Words provides no other support for document versions. If you save this document using Aspose.Words, the document will be saved without versions.
Shows how to work with the versions count feature of older Microsoft Word documents.
System::SharedPtr<Aspose::Words::Settings::ViewOptions> Aspose::Words::Document::get_ViewOptions | ( | ) |
Provides options to control how the document is displayed in Microsoft Word.
Shows how to set a custom zoom factor, which older versions of Microsoft Word will apply to a document upon loading.
Shows how to set a custom zoom type, which older versions of Microsoft Word will apply to a document upon loading.
System::SharedPtr<Aspose::Words::Watermark> Aspose::Words::Document::get_Watermark | ( | ) |
Provides access to the document watermark.
System::SharedPtr<Aspose::Words::WebExtensions::TaskPaneCollection> Aspose::Words::Document::get_WebExtensionTaskPanes | ( | ) | const |
Returns a collection that represents a list of task pane add-ins.
System::SharedPtr<Aspose::Words::Settings::WriteProtection> Aspose::Words::Document::get_WriteProtection | ( | ) |
Provides access to the document write protection options.
Shows how to protect a document with a password.
System::SharedPtr<Aspose::Words::Rendering::PageInfo> Aspose::Words::Document::GetPageInfo | ( | int32_t | pageIndex | ) |
Gets the page size, orientation and other information about a page that might be useful for printing or rendering.
pageIndex | The 0-based page index. |
|
overridevirtual |
Reimplemented from Aspose::Words::DocumentBase.
|
overridevirtual |
Reimplemented from Aspose::Words::DocumentBase.
int32_t Aspose::Words::Document::JoinRunsWithSameFormatting | ( | ) |
Joins runs with same formatting in all paragraphs of the document.
This is an optimization method. Some documents contain adjacent runs with same formatting. Usually this occurs if a document was intensively edited manually. You can reduce the document size and speed up further processing by joining these runs.
The operation checks every Paragraph node in the document for adjacent Run nodes having identical properties. It ignores unique identifiers used to track editing sessions of run creation and modification. First run in every joining sequence accumulates all text. Remaining runs are deleted from the document.
Shows how to join runs in a document to reduce unneeded runs.
void Aspose::Words::Document::NormalizeFieldTypes | ( | ) |
Changes field type values FieldType of FieldStart, FieldSeparator, FieldEnd in the whole document so that they correspond to the field types contained in the field codes.
Use this method after document changes that affect field types.
To change field type values in a specific part of the document use NormalizeFieldTypes.
Shows how to get the keep a field's type up to date with its field code.
void Aspose::Words::Document::Protect | ( | Aspose::Words::ProtectionType | type | ) |
Protects the document from changes without changing the existing password or assigns a random password.
When a document is protected, the user can make only limited changes, such as adding annotations, making revisions, or completing a form.
When you protect a document, and the document already has a protection password, the existing protection password is not changed.
When you protect a document, and the document does not have a protection password, this method assigns a random password that makes it impossible to unprotect the document in Microsoft Word, but you still can unprotect the document in Aspose.Words as it does not require a password when unprotecting.
type | Specifies the protection type for the document. |
Shows how to turn off protection for a section.
void Aspose::Words::Document::Protect | ( | Aspose::Words::ProtectionType | type, |
System::String | password | ||
) |
Protects the document from changes and optionally sets a protection password.
When a document is protected, the user can make only limited changes, such as adding annotations, making revisions, or completing a form.
Note that document protection is different from write protection. Write protection is specified using the WriteProtection.
type | Specifies the protection type for the document. |
password | The password to protect the document with. Specify null or empty string if you want to protect the document without a password. |
Shows how to protect and unprotect a document.
|
override |
Removes itself from the parent.
void Aspose::Words::Document::RemoveExternalSchemaReferences | ( | ) |
Removes external XML schema references from this document.
Shows how to remove all external XML schema references from a document.
void Aspose::Words::Document::RemoveMacros | ( | ) |
Removes all macros (the VBA project) as well as toolbars and command customizations from the document.
By removing all macros from a document you can ensure the document contains no macro viruses.
Shows how to remove all macros from a document.
System::Drawing::SizeF Aspose::Words::Document::RenderToScale | ( | int32_t | pageIndex, |
System::SharedPtr< System::Drawing::Graphics > | graphics, | ||
float | x, | ||
float | y, | ||
float | scale | ||
) |
Renders a document page into a object to a specified scale.
pageIndex | The 0-based page index. |
graphics | The object where to render to. |
x | The X coordinate (in world units) of the top left corner of the rendered page. |
y | The Y coordinate (in world units) of the top left corner of the rendered page. |
scale | The scale for rendering the page (1.0 is 100%). |
Shows how to the individual pages of a document to graphics to create one image with thumbnails of all pages.
float Aspose::Words::Document::RenderToSize | ( | int32_t | pageIndex, |
System::SharedPtr< System::Drawing::Graphics > | graphics, | ||
float | x, | ||
float | y, | ||
float | width, | ||
float | height | ||
) |
Renders a document page into a object to a specified size.
pageIndex | The 0-based page index. |
graphics | The object where to render to. |
x | The X coordinate (in world units) of the top left corner of the rendered page. |
y | The Y coordinate (in world units) of the top left corner of the rendered page. |
width | The maximum width (in world units) that can be occupied by the rendered page. |
height | The maximum height (in world units) that can be occupied by the rendered page. |
Shows how to render a document to a bitmap at a specified location and size.
System::SharedPtr<Aspose::Words::Saving::SaveOutputParameters> Aspose::Words::Document::Save | ( | System::SharedPtr< System::IO::Stream > | stream, |
Aspose::Words::SaveFormat | saveFormat | ||
) |
Saves the document to a stream using the specified format.
stream | Stream where to save the document. |
saveFormat | The format in which to save the document. |
Shows how to save a document to an image via stream, and then read the image from that stream.
Shows how to save a document to a stream.
System::SharedPtr<Aspose::Words::Saving::SaveOutputParameters> Aspose::Words::Document::Save | ( | System::SharedPtr< System::IO::Stream > | stream, |
System::SharedPtr< Aspose::Words::Saving::SaveOptions > | saveOptions | ||
) |
Saves the document to a stream using the specified save options.
stream | Stream where to save the document. |
saveOptions | Specifies the options that control how the document is saved. Can be null. If this is null, the document will be saved in the binary DOC format. |
Shows how to convert only some of the pages in a document to PDF.
System::SharedPtr<Aspose::Words::Saving::SaveOutputParameters> Aspose::Words::Document::Save | ( | System::String | fileName | ) |
Saves the document to a file. Automatically determines the save format from the extension.
fileName | The name for the document. If a document with the specified file name already exists, the existing document is overwritten. |
Shows how to open a document and convert it to .PDF.
System::SharedPtr<Aspose::Words::Saving::SaveOutputParameters> Aspose::Words::Document::Save | ( | System::String | fileName, |
Aspose::Words::SaveFormat | saveFormat | ||
) |
Saves the document to a file in the specified format.
fileName | The name for the document. If a document with the specified file name already exists, the existing document is overwritten. |
saveFormat | The format in which to save the document. |
Shows how to convert from DOCX to HTML format.
System::SharedPtr<Aspose::Words::Saving::SaveOutputParameters> Aspose::Words::Document::Save | ( | System::String | fileName, |
System::SharedPtr< Aspose::Words::Saving::SaveOptions > | saveOptions | ||
) |
Saves the document to a file using the specified save options.
fileName | The name for the document. If a document with the specified file name already exists, the existing document is overwritten. |
saveOptions | Specifies the options that control how the document is saved. Can be null. |
Shows how to improve the quality of a rendered document with SaveOptions.
Shows how to render one page from a document to a JPEG image.
Shows how to render every page of a document to a separate TIFF image.
Shows how to configure compression while saving a document as a JPEG.
Shows how to convert a whole document to PDF with three levels in the document outline.
void Aspose::Words::Document::set_AttachedTemplate | ( | System::String | value | ) |
Setter for Aspose::Words::Document::get_AttachedTemplate.
void Aspose::Words::Document::set_AutomaticallyUpdateStyles | ( | bool | value | ) |
void Aspose::Words::Document::set_CustomXmlParts | ( | System::SharedPtr< Aspose::Words::Markup::CustomXmlPartCollection > | value | ) |
Setter for Aspose::Words::Document::get_CustomXmlParts.
void Aspose::Words::Document::set_DefaultTabStop | ( | double | value | ) |
Setter for Aspose::Words::Document::get_DefaultTabStop.
void Aspose::Words::Document::set_FontSettings | ( | System::SharedPtr< Aspose::Words::Fonts::FontSettings > | value | ) |
Setter for Aspose::Words::Document::get_FontSettings.
void Aspose::Words::Document::set_GlossaryDocument | ( | System::SharedPtr< Aspose::Words::BuildingBlocks::GlossaryDocument > | value | ) |
Setter for Aspose::Words::Document::get_GlossaryDocument.
void Aspose::Words::Document::set_GrammarChecked | ( | bool | value | ) |
Setter for Aspose::Words::Document::get_GrammarChecked.
void Aspose::Words::Document::set_MailMergeSettings | ( | System::SharedPtr< Aspose::Words::Settings::MailMergeSettings > | value | ) |
Setter for Aspose::Words::Document::get_MailMergeSettings.
void Aspose::Words::Document::set_PackageCustomParts | ( | System::SharedPtr< Aspose::Words::Markup::CustomPartCollection > | value | ) |
Setter for Aspose::Words::Document::get_PackageCustomParts.
void Aspose::Words::Document::set_RemovePersonalInformation | ( | bool | value | ) |
void Aspose::Words::Document::set_RevisionsView | ( | Aspose::Words::RevisionsView | value | ) |
Setter for Aspose::Words::Document::get_RevisionsView.
void Aspose::Words::Document::set_ShadeFormData | ( | bool | value | ) |
Setter for Aspose::Words::Document::get_ShadeFormData.
void Aspose::Words::Document::set_ShowGrammaticalErrors | ( | bool | value | ) |
void Aspose::Words::Document::set_ShowSpellingErrors | ( | bool | value | ) |
Setter for Aspose::Words::Document::get_ShowSpellingErrors.
void Aspose::Words::Document::set_SpellingChecked | ( | bool | value | ) |
Setter for Aspose::Words::Document::get_SpellingChecked.
void Aspose::Words::Document::set_TrackRevisions | ( | bool | value | ) |
Setter for Aspose::Words::Document::get_TrackRevisions.
void Aspose::Words::Document::set_VbaProject | ( | System::SharedPtr< Aspose::Words::Vba::VbaProject > | value | ) |
Setter for Aspose::Words::Document::get_VbaProject.
void Aspose::Words::Document::StartTrackRevisions | ( | System::String | author | ) |
Starts automatically marking all further changes you make to the document programmatically as revision changes.
If you call this method and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
Currently Aspose.Words supports tracking of node insertions and deletions only. Formatting changes are not recorded as revisions.
Automatic tracking of changes is supported both when modifying this document through node manipulations as well as when using DocumentBuilder
This method does not change the TrackRevisions option and does not use its value for the purposes of revision tracking.
author | Initials of the author to use for revisions. |
Shows how to track revisions while editing a document.
void Aspose::Words::Document::StartTrackRevisions | ( | System::String | author, |
System::DateTime | dateTime | ||
) |
Starts automatically marking all further changes you make to the document programmatically as revision changes.
If you call this method and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
Currently Aspose.Words supports tracking of node insertions and deletions only. Formatting changes are not recorded as revisions.
Automatic tracking of changes is supported both when modifying this document through node manipulations as well as when using DocumentBuilder
This method does not change the TrackRevisions option and does not use its value for the purposes of revision tracking.
author | Initials of the author to use for revisions. |
dateTime | The date and time to use for revisions. |
Shows how to track revisions while editing a document.
void Aspose::Words::Document::StopTrackRevisions | ( | ) |
Stops automatic marking of document changes as revisions.
Shows how to track revisions while editing a document.
|
static |
void Aspose::Words::Document::UnlinkFields | ( | ) |
Unlinks fields in the whole document.
Replaces all the fields in the whole document with their most recent results.
To unlink fields in a specific part of the document use UnlinkFields.
Shows how to unlink all fields in the document.
void Aspose::Words::Document::Unprotect | ( | ) |
Removes protection from the document regardless of the password.
This method unprotects the document even if it has a protection password.
Note that document protection is different from write protection. Write protection is specified using the WriteProtection.
Shows how to protect and unprotect a document.
bool Aspose::Words::Document::Unprotect | ( | System::String | password | ) |
Removes protection from the document if a correct password is specified.
This method unprotects the document only if a correct password is specified.
Note that document protection is different from write protection. Write protection is specified using the WriteProtection.
password | The password to unprotect the document with. |
Shows how to protect and unprotect a document.
void Aspose::Words::Document::UpdateFields | ( | ) |
Updates the values of fields in the whole document.
When you open, modify and then save a document, Aspose.Words does not update fields automatically, it keeps them intact. Therefore, you would usually want to call this method before saving if you have modified the document programmatically and want to make sure the proper (calculated) field values appear in the saved document.
There is no need to update fields after executing a mail merge because mail merge is a kind of field update and automatically updates all fields in the document.
This method does not update all field types. For the detailed list of supported field types, see the Programmers Guide.
This method does not update fields that are related to the page layout algorithms (e.g. PAGE, PAGES, PAGEREF). The page layout-related fields are updated when you render a document or call UpdatePageLayout.
Use the NormalizeFieldTypes method before fields updating if there were document changes that affected field types.
To update fields in a specific part of the document use UpdateFields.
Shows how to insert a Table of contents (TOC) into a document using heading styles as entries.
Shows to use the QUOTE field.
Shows how to set user details, and display them using fields.
void Aspose::Words::Document::UpdateListLabels | ( | ) |
Updates list labels for all list items in the document.
This method updates list label properties such as LabelValue and LabelString for each ListLabel object in the document.
Also, this method is sometimes implicitly called when updating fields in the document. This is required because some fields that may reference list numbers (such as TOC or REF) need them be up-to-date.
Shows how to extract the list labels of all paragraphs that are list items.
void Aspose::Words::Document::UpdatePageLayout | ( | ) |
Rebuilds the page layout of the document.
This method formats a document into pages and updates the page number related fields in the document such as PAGE, PAGES, PAGEREF and REF. The up-to-date page layout information is required for a correct rendering of the document to fixed-page formats.
This method is automatically invoked when you first convert a document to PDF, XPS, image or print it. However, if you modify the document after rendering and then attempt to render it again - Aspose.Words will not update the page layout automatically. In this case you should call UpdatePageLayout before rendering again.
Shows when to recalculate the page layout of the document.
void Aspose::Words::Document::UpdateTableLayout | ( | ) |
Updates widths of cells and tables in the document according to their preferred widths and content. You do not need to call this method if the tables appear correct in the output document.
You do not normally need to call this method as cell and table widths are maintained automatically. You can call this method before exporting to PDF (or any other fixed-page format), only in rare cases where you confirmed that tables appear incorrectly laid out in the output document. Calling this method might help to correct the output.
Shows how to preserve a table's layout when saving to .txt.
void Aspose::Words::Document::UpdateThumbnail | ( | ) |
Updates Thumbnail of the document using default options.
Shows how to update a document's thumbnail.
void Aspose::Words::Document::UpdateThumbnail | ( | System::SharedPtr< Aspose::Words::Rendering::ThumbnailGeneratingOptions > | options | ) |
Updates Thumbnail of the document according to the specified options.
options | The generating options to use. |
Shows how to update a document's thumbnail.
void Aspose::Words::Document::UpdateWordCount | ( | ) |
Updates word count properties of the document.
UpdateWordCount recalculates and updates Characters, Words and Paragraphs properties in the BuiltInDocumentProperties collection of the Document.
Note that UpdateWordCount does not update number of lines and pages properties. Use the UpdateWordCount overload and pass True value as a parameter to do that.
When you use an evaluation version, the evaluation watermark will also be included in the word count.
Shows how to update all list labels in a document.
void Aspose::Words::Document::UpdateWordCount | ( | bool | updateLinesCount | ) |
Updates word count properties of the document, optionally updates Lines property.
updateLinesCount | True if number of lines in the document shall be calculated. |
Shows how to update all list labels in a document.