Aspose::Words::Document Class Reference

Represents a Word document. More...

#include "Model/Document/Document.h"

Inherits Aspose::Words::DocumentBase, and ISectionAttrSource.

Public Member Functions

System::String get_AttachedTemplate ()
 Gets or sets the full path of the template attached to the document. More...
 
void set_AttachedTemplate (System::String value)
 Setter for Aspose::Words::Document::get_AttachedTemplate. More...
 
bool get_AutomaticallyUpdateSyles ()
 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...
 
void set_AutomaticallyUpdateSyles (bool value)
 Setter for Aspose::Words::Document::get_AutomaticallyUpdateSyles. More...
 
bool get_ShadeFormData ()
 Specifies whether to turn on the gray shading on form fields. More...
 
void set_ShadeFormData (bool value)
 Setter for Aspose::Words::Document::get_ShadeFormData. More...
 
bool get_TrackRevisions ()
 True if changes are tracked when this document is edited in Microsoft Word. More...
 
void set_TrackRevisions (bool value)
 Setter for Aspose::Words::Document::get_TrackRevisions. More...
 
virtual Aspose::Words::NodeType get_NodeType () const
 Returns NodeType.Document. More...
 
System::SharedPtr< Aspose::Words::Properties::BuiltInDocumentPropertiesget_BuiltInDocumentProperties () const
 Returns a collection that represents all the built-in document properties of the document. More...
 
System::SharedPtr< Aspose::Words::Properties::CustomDocumentPropertiesget_CustomDocumentProperties () const
 Returns a collection that represents all the custom document properties of the document. More...
 
System::SharedPtr< Aspose::Words::MailMerging::MailMergeget_MailMerge ()
 Returns a MailMerge object that represents the mail merge functionality for the document. More...
 
Aspose::Words::ProtectionType get_ProtectionType ()
 Gets the currently active document protection type. More...
 
System::SharedPtr< Aspose::Words::SectionCollectionget_Sections ()
 Returns a collection that represents all sections in the document. More...
 
System::SharedPtr< Aspose::Words::Sectionget_FirstSection ()
 Gets the first section in the document. More...
 
System::SharedPtr< Aspose::Words::Sectionget_LastSection ()
 Gets the last section in the document. More...
 
System::SharedPtr< Aspose::Words::Settings::ViewOptionsget_ViewOptions ()
 Provides options to control how the document is displayed in Microsoft Word. More...
 
System::SharedPtr< Aspose::Words::Settings::WriteProtectionget_WriteProtection ()
 Provides access to the document write protection options. More...
 
System::SharedPtr< Aspose::Words::Settings::CompatibilityOptionsget_CompatibilityOptions ()
 Provides access to document compatibility options (that is, the user preferences entered on the Compatibility tab of the Options dialog in Word). More...
 
System::SharedPtr< Aspose::Words::Settings::MailMergeSettingsget_MailMergeSettings ()
 Gets or sets the object that contains all of the mail merge information for a document. More...
 
void set_MailMergeSettings (System::SharedPtr< Aspose::Words::Settings::MailMergeSettings > value)
 Setter for Aspose::Words::Document::get_MailMergeSettings. More...
 
System::SharedPtr< Aspose::Words::Settings::HyphenationOptionsget_HyphenationOptions ()
 Provides access to document hyphenation options. More...
 
bool get_HasRevisions ()
 Returns true if the document has any tracked changes. More...
 
bool get_HasMacros ()
 Returns true if the document has a VBA project (macros). More...
 
int32_t get_VersionsCount ()
 Gets the number of document versions that was stored in the DOC document. More...
 
double get_DefaultTabStop ()
 Gets or sets the interval (in points) between the default tab stops. More...
 
void set_DefaultTabStop (double value)
 Setter for Aspose::Words::Document::get_DefaultTabStop. More...
 
System::SharedPtr< Aspose::Words::Themes::Theme > get_Theme ()
 Gets the Aspose::Words::Document::get_Theme object for this document. More...
 
System::SharedPtr< Aspose::Words::Markup::CustomXmlPartCollectionget_CustomXmlParts () const
 Gets or sets the collection of Custom XML Data Storage Parts. More...
 
void set_CustomXmlParts (System::SharedPtr< Aspose::Words::Markup::CustomXmlPartCollection > value)
 Setter for Aspose::Words::Document::get_CustomXmlParts. More...
 
System::SharedPtr< Aspose::Words::Markup::CustomPartCollectionget_PackageCustomParts () const
 Gets or sets the collection of custom parts (arbitrary content) that are linked to the OOXML package using "unknown relationships". More...
 
void set_PackageCustomParts (System::SharedPtr< Aspose::Words::Markup::CustomPartCollection > value)
 Setter for Aspose::Words::Document::get_PackageCustomParts. More...
 
System::SharedPtr< Aspose::Words::VariableCollectionget_Variables ()
 Returns the collection of variables added to a document or template. More...
 
System::SharedPtr< Aspose::Words::BuildingBlocks::GlossaryDocumentget_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...
 
void set_GlossaryDocument (System::SharedPtr< Aspose::Words::BuildingBlocks::GlossaryDocument > value)
 Setter for Aspose::Words::Document::get_GlossaryDocument. More...
 
System::String get_OriginalFileName () const
 Gets the original file name of the document. More...
 
Aspose::Words::LoadFormat get_OriginalLoadFormat () const
 Gets the format of the original document that was loaded into this object. More...
 
Aspose::Words::Saving::OoxmlCompliance get_Compliance ()
 Gets the OOXML compliance version determined from the loaded document content. Makes sense only for OOXML documents. More...
 
System::SharedPtr< Aspose::Words::Fonts::FontSettingsget_FontSettings () const
 Gets or sets document font settings. More...
 
void set_FontSettings (System::SharedPtr< Aspose::Words::Fonts::FontSettings > value)
 Setter for Aspose::Words::Document::get_FontSettings. More...
 
int32_t get_PageCount ()
 Gets the number of pages in the document as calculated by the most recent page layout operation. More...
 
System::SharedPtr< Aspose::Words::RevisionCollectionget_Revisions ()
 Gets a collection of revisions (tracked changes) that exist in this document. More...
 
System::SharedPtr< Aspose::Words::Layout::LayoutOptionsget_LayoutOptions () const
 Gets a LayoutOptions object that represents options to control the layout process of this document. More...
 
System::SharedPtr< Aspose::Words::FootnoteOptionsget_FootnoteOptions ()
 Provides options that control numbering and positioning of footnotes in this document. More...
 
System::SharedPtr< Aspose::Words::EndnoteOptionsget_EndnoteOptions ()
 Provides options that control numbering and positioning of endnotes in this document. More...
 
System::SharedPtr< Aspose::Words::Fields::FieldOptionsget_FieldOptions ()
 Gets a FieldOptions object that represents options to control field handling in the document. 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...
 
void set_RemovePersonalInformation (bool value)
 Setter for Aspose::Words::Document::get_RemovePersonalInformation. More...
 
System::SharedPtr< Aspose::Words::VbaProjectget_VbaProject ()
 Gets Aspose::Words::Document::get_VbaProject containing in the document. More...
 
 Document ()
 Creates a blank Word document. More...
 
 Document (System::String fileName)
 Opens an existing document from a file. Automatically detects the file format. More...
 
 Document (System::String fileName, System::SharedPtr< Aspose::Words::LoadOptions > loadOptions)
 Opens an existing document from a file. Allows to specify additional options such as an encryption password. More...
 
 Document (System::SharedPtr< System::IO::Stream > stream)
 Opens an existing document from a stream. Automatically detects the file format. More...
 
 Document (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< Aspose::Words::LoadOptions > loadOptions)
 Opens an existing document from a stream. Allows to specify additional options such as an encryption password. More...
 
System::SharedPtr< Aspose::Words::DocumentClone ()
 Performs a deep copy of the Aspose::Words::Document. More...
 
virtual bool Accept (System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)
 Accepts a visitor. More...
 
void AppendDocument (System::SharedPtr< Aspose::Words::Document > srcDoc, Aspose::Words::ImportFormatMode importFormatMode)
 Appends the specified document to the end of this document. More...
 
void 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. More...
 
System::SharedPtr< Aspose::Words::Saving::SaveOutputParametersSave (System::String fileName)
 Saves the document to a file. Automatically determines the save format from the extension. More...
 
System::SharedPtr< Aspose::Words::Saving::SaveOutputParametersSave (System::String fileName, Aspose::Words::SaveFormat saveFormat)
 Saves the document to a file in the specified format. More...
 
System::SharedPtr< Aspose::Words::Saving::SaveOutputParametersSave (System::String fileName, System::SharedPtr< Aspose::Words::Saving::SaveOptions > saveOptions)
 Saves the document to a file using the specified save options. More...
 
System::SharedPtr< Aspose::Words::Saving::SaveOutputParametersSave (System::SharedPtr< System::IO::Stream > stream, Aspose::Words::SaveFormat saveFormat)
 Saves the document to a stream using the specified format. More...
 
System::SharedPtr< Aspose::Words::Saving::SaveOutputParametersSave (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< Aspose::Words::Saving::SaveOptions > saveOptions)
 Saves the document to a stream using the specified save options. More...
 
void EnsureMinimum ()
 If the document contains no sections, creates one section with one paragraph. More...
 
void AcceptAllRevisions ()
 Accepts all tracked changes in the document. More...
 
void Protect (Aspose::Words::ProtectionType type)
 Protects the document from changes without changing the existing password or assigns a random password. More...
 
void Protect (Aspose::Words::ProtectionType type, System::String password)
 Protects the document from changes and optionally sets a protection password. More...
 
void Unprotect ()
 Removes protection from the document regardless of the password. More...
 
bool Unprotect (System::String password)
 Removes protection from the document if a correct password is specified. More...
 
void UpdateWordCount ()
 Updates word count properties of the document. More...
 
void UpdateWordCount (bool updateLinesCount)
 Updates word count properties of the document, optionally updates Aspose::Words::Properties::BuiltInDocumentProperties::get_Lines property. 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 UpdateListLabels ()
 Updates list labels for all list items in the document. More...
 
void RemoveMacros ()
 Removes all macros (the VBA project) as well as toolbars and command customizations from the document. More...
 
void UpdateFields ()
 Updates the values of fields in the whole document. More...
 
void UnlinkFields ()
 Unlinks fields in the whole document. More...
 
void NormalizeFieldTypes ()
 Changes field type values Aspose::Words::Fields::FieldChar::get_FieldType of Aspose::Words::Fields::FieldStart, Aspose::Words::Fields::FieldSeparator, Aspose::Words::Fields::FieldEnd in the whole document so that they correspond to the field types contained in the field codes. More...
 
int32_t JoinRunsWithSameFormatting ()
 Joins runs with same formatting in all paragraphs of the document. More...
 
void ExpandTableStylesToDirectFormatting ()
 Converts formatting specified in table styles into direct formatting on tables in the document. More...
 
void Cleanup ()
 Cleans unused styles and lists from the document. More...
 
void Cleanup (System::SharedPtr< Aspose::Words::CleanupOptions > options)
 Cleans unused styles and lists from the document depending on given Aspose::Words::CleanupOptions. More...
 
void RemoveExternalSchemaReferences ()
 Removes external XML schema references from this document. More...
 
void StartTrackRevisions (System::String author, System::DateTime dateTime)
 Starts automatically marking all further changes you make to the document programmatically as revision changes. More...
 
void StartTrackRevisions (System::String author)
 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 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 Aspose::Words::Revision. More...
 
void Compare (System::SharedPtr< Aspose::Words::Document > document, System::String author, System::DateTime dateTime, System::SharedPtr< Aspose::Words::CompareOptions > options)
 Compares this document with another document producing changes as a number of edit and format revisions Aspose::Words::Revision. Allows to specify comparison options using Aspose::Words::CompareOptions. More...
 
void CopyStylesFromTemplate (System::String template_)
 Copies styles from the specified template to a document. More...
 
void CopyStylesFromTemplate (System::SharedPtr< Aspose::Words::Document > template_)
 Copies styles from the specified template to a document. More...
 
void UpdatePageLayout ()
 Rebuilds the page layout of the document. More...
 
System::Drawing::SizeF RenderToScale (int32_t pageIndex, System::SharedPtr< System::Drawing::Graphics > graphics, float x, float y, float scale)
 Renders a document page into a System::Drawing::Graphics object to a specified scale. More...
 
float RenderToSize (int32_t pageIndex, System::SharedPtr< System::Drawing::Graphics > graphics, float x, float y, float width, float height)
 
System::SharedPtr< Aspose::Words::Rendering::PageInfoGetPageInfo (int32_t pageIndex)
 Gets the page size, orientation and other information about a page that might be useful for printing or rendering. More...
 
void UpdateThumbnail (System::SharedPtr< Aspose::Words::Rendering::ThumbnailGeneratingOptions > options)
 Updates Aspose::Words::Properties::BuiltInDocumentProperties::get_Thumbnail of the document according to the specified options. More...
 
void UpdateThumbnail ()
 Updates Aspose::Words::Properties::BuiltInDocumentProperties::get_Thumbnail of the document using default options. More...
 
System::SharedPtr< System::ObjectGetDirectSectionAttr (int32_t key)
 
System::SharedPtr< System::ObjectFetchInheritedSectionAttr (int32_t key)
 
System::SharedPtr< System::ObjectFetchSectionAttr (int32_t key)
 
void SetSectionAttr (int32_t key, System::SharedPtr< System::Object > value)
 
void ClearSectionAttrs ()
 
- Public Member Functions inherited from Aspose::Words::DocumentBase
System::SharedPtr< Aspose::Words::INodeChangingCallback > get_NodeChangingCallback ()
 Called when a node is inserted or removed in the document. More...
 
void set_NodeChangingCallback (System::SharedPtr< Aspose::Words::INodeChangingCallback > value)
 Setter for Aspose::Words::DocumentBase::get_NodeChangingCallback. More...
 
System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > get_ResourceLoadingCallback () const
 Allows to control how external resources are loaded. More...
 
void set_ResourceLoadingCallback (System::SharedPtr< Aspose::Words::Loading::IResourceLoadingCallback > value)
 Setter for Aspose::Words::DocumentBase::get_ResourceLoadingCallback. More...
 
System::SharedPtr< Aspose::Words::Fonts::FontInfoCollectionget_FontInfos () const
 Provides access to properties of fonts used in this document. More...
 
System::SharedPtr< Aspose::Words::StyleCollectionget_Styles () const
 Returns a collection of styles defined in the document. More...
 
System::SharedPtr< Aspose::Words::Lists::ListCollectionget_Lists () const
 Provides access to the list formatting used in the document. More...
 
System::SharedPtr< Aspose::Words::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...
 
void set_WarningCallback (System::SharedPtr< Aspose::Words::IWarningCallback > value)
 Setter for Aspose::Words::DocumentBase::get_WarningCallback. More...
 
System::SharedPtr< Aspose::Words::Drawing::Shapeget_BackgroundShape () const
 Gets or sets the background shape of the document. Can be null. More...
 
void set_BackgroundShape (System::SharedPtr< Aspose::Words::Drawing::Shape > value)
 Setter for Aspose::Words::DocumentBase::get_BackgroundShape. More...
 
System::Drawing::Color get_PageColor ()
 Gets or sets the page color of the document. This property is a simpler version of Aspose::Words::DocumentBase::get_BackgroundShape. More...
 
void set_PageColor (System::Drawing::Color value)
 Setter for Aspose::Words::DocumentBase::get_PageColor. More...
 
System::SharedPtr< Aspose::Words::NodeImportNode (System::SharedPtr< Aspose::Words::Node > srcNode, bool isImportChildren)
 
System::SharedPtr< Aspose::Words::NodeImportNode (System::SharedPtr< Aspose::Words::Node > srcNode, bool isImportChildren, Aspose::Words::ImportFormatMode importFormatMode)
 
- Public Member Functions inherited from Aspose::Words::CompositeNode
virtual bool get_IsComposite ()
 Returns true as this node can have child nodes. More...
 
bool get_HasChildNodes ()
 Returns true if this node has any child nodes. More...
 
System::SharedPtr< Aspose::Words::NodeCollectionget_ChildNodes ()
 Gets all immediate child nodes of this node. More...
 
System::SharedPtr< Aspose::Words::Nodeget_FirstChild () const
 Gets the first child of the node. More...
 
System::SharedPtr< Aspose::Words::Nodeget_LastChild () const
 Gets the last child of the node. More...
 
int32_t get_Count ()
 Gets the number of immediate children of this node. More...
 
System::SharedPtr< Aspose::Words::CompositeNodeget_Container ()
 
virtual ~CompositeNode ()
 
virtual System::String GetText ()
 Gets the text of this node and of all its children. More...
 
System::SharedPtr< Aspose::Words::NodeCollectionGetChildNodes (Aspose::Words::NodeType nodeType, bool isDeep)
 Returns a live collection of child nodes that match the specified type. More...
 
System::SharedPtr< Aspose::Words::NodeGetChild (Aspose::Words::NodeType nodeType, int32_t index, bool isDeep)
 Returns an Nth child node that matches the specified type. More...
 
System::SharedPtr< Aspose::Words::NodeList > SelectNodes (System::String xpath)
 Selects a list of nodes matching the XPath expression. More...
 
System::SharedPtr< Aspose::Words::NodeSelectSingleNode (System::String xpath)
 Selects the first Node that matches the XPath expression. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Aspose::Words::Node > > > GetEnumerator ()
 Provides support for the for each style iteration over the child nodes of this node. More...
 
System::SharedPtr< Aspose::Words::NodeAppendChild (System::SharedPtr< Aspose::Words::Node > newChild)
 Adds the specified node to the end of the list of child nodes for this node. More...
 
System::SharedPtr< Aspose::Words::NodePrependChild (System::SharedPtr< Aspose::Words::Node > newChild)
 Adds the specified node to the beginning of the list of child nodes for this node. More...
 
System::SharedPtr< Aspose::Words::NodeInsertAfter (System::SharedPtr< Aspose::Words::Node > newChild, System::SharedPtr< Aspose::Words::Node > refChild)
 Inserts the specified node immediately after the specified reference node. More...
 
System::SharedPtr< Aspose::Words::NodeInsertBefore (System::SharedPtr< Aspose::Words::Node > newChild, System::SharedPtr< Aspose::Words::Node > refChild)
 Inserts the specified node immediately before the specified reference node. More...
 
System::SharedPtr< Aspose::Words::NodeRemoveChild (System::SharedPtr< Aspose::Words::Node > oldChild)
 Removes the specified child node. More...
 
void RemoveAllChildren ()
 Removes all the child nodes of the current node. More...
 
void RemoveSmartTags ()
 Removes all Aspose::Words::Markup::SmartTag descendant nodes of the current node. More...
 
int32_t IndexOf (System::SharedPtr< Aspose::Words::Node > child)
 Returns the index of the specified child node in the child node array. More...
 
System::SharedPtr< Aspose::Words::NodeGetNextMatchingNode (System::SharedPtr< Aspose::Words::Node > &curNode)
 
virtual void dd ()
 
- Public Member Functions inherited from Aspose::Words::Node
System::SharedPtr< Aspose::Words::CompositeNodeget_ParentNode ()
 Gets the immediate parent of this node. More...
 
System::SharedPtr< Aspose::Words::DocumentBaseget_Document ()
 Gets the document to which this node belongs. More...
 
System::SharedPtr< Aspose::Words::Nodeget_PreviousSibling ()
 Gets the node immediately preceding this node. More...
 
System::SharedPtr< Aspose::Words::Nodeget_NextSibling ()
 Gets the node immediately following this node. More...
 
System::SharedPtr< Aspose::Words::Rangeget_Range ()
 Returns a Range object that represents the portion of a document that is contained in this node. More...
 
System::SharedPtr< Aspose::Words::NodeClone (bool isCloneChildren)
 
template<typename T >
GetAncestorOf ()
 
System::SharedPtr< Aspose::Words::CompositeNodeGetAncestor (Aspose::Words::NodeType ancestorType)
 Gets the first ancestor of the specified Aspose::Words::NodeType. More...
 
void Remove ()
 Removes itself from the parent. More...
 
System::SharedPtr< Aspose::Words::NodeNextPreOrder (System::SharedPtr< Aspose::Words::Node > rootNode)
 Gets next node according to the pre-order tree traversal algorithm. More...
 
System::SharedPtr< Aspose::Words::NodePreviousPreOrder (System::SharedPtr< Aspose::Words::Node > rootNode)
 Gets the previous node according to the pre-order tree traversal algorithm. More...
 
System::String ToString (Aspose::Words::SaveFormat saveFormat)
 Exports the content of the node into a string in the specified format. More...
 
System::String ToString (System::SharedPtr< Aspose::Words::Saving::SaveOptions > saveOptions)
 Exports the content of the node into a string using the specified save options. More...
 
virtual System::String ToString () const
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 
- Public Types inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Words::Node > >
typedef IEnumerator< System::SharedPtr< Aspose::Words::Node > > IEnumeratorType
 Enumerator type. More...
 
- Static Public Member Functions inherited from Aspose::Words::Node
static System::String NodeTypeToString (Aspose::Words::NodeType nodeType)
 A utility method that converts a node type enum value into a user friendly string. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Represents a Word document.

The Document is a central object in the Aspose.Words library.

To load an existing document in any of the Aspose::Words::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 Aspose::Words::SaveFormat formats.

To draw document pages directly onto a Graphics object use Aspose::Words::Document::RenderToScale(int32_t, System::SharedPtr<$System::Drawing::Graphics>, float, float, float) or Aspose::Words::Document::RenderToSize(int32_t, System::SharedPtr<$System::Drawing::Graphics>, float, float, float, float) method.

To print the document, use one of the Aspose::Words::Document::Print(System::String) methods.

Aspose::Words::Document::get_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 DataSet, DataTable, DataView, IDataReader 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 Aspose::Words::DocumentBase::get_Styles, Aspose::Words::Document::get_BuiltInDocumentProperties, Aspose::Words::Document::get_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 Aspose::Words::DocumentBuilder that simplifies the task of programmatically creating or populating the document tree.

The Document can contain only Aspose::Words::Section objects.

In Microsoft Word, a valid document needs to have at least one section.

Constructor & Destructor Documentation

◆ Document() [1/5]

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 Aspose::Words::DocumentBuilder to add document content easily.

◆ Document() [2/5]

Aspose::Words::Document::Document ( System::String  fileName)

Opens an existing document from a file. Automatically detects the file format.

Parameters
fileNameFile name of the document to open.
Exceptions
T:Aspose.Words.UnsupportedFileFormatExceptionThe document format is not recognized or not supported.
T:Aspose.Words.FileCorruptedExceptionThe document appears to be corrupted and cannot be loaded.
T:System.ExceptionThere is a problem with the document and it should be reported to Aspose.Words developers.
T:System.IO.IOExceptionThere is an input/output exception.
T:Aspose.Words.IncorrectPasswordExceptionThe document is encrypted and requires a password to open, but you supplied an incorrect password.
T:System.ArgumentExceptionThe name of the file cannot be null or empty string.

◆ Document() [3/5]

Aspose::Words::Document::Document ( System::String  fileName,
System::SharedPtr< Aspose::Words::LoadOptions loadOptions 
)

Opens an existing document from a file. Allows to specify additional options such as an encryption password.

Parameters
fileNameFile name of the document to open.
loadOptionsAdditional options to use when loading a document. Can be null.
Exceptions
T:Aspose.Words.UnsupportedFileFormatExceptionThe document format is not recognized or not supported.
T:Aspose.Words.FileCorruptedExceptionThe document appears to be corrupted and cannot be loaded.
T:System.ExceptionThere is a problem with the document and it should be reported to Aspose.Words developers.
T:System.IO.IOExceptionThere is an input/output exception.
T:Aspose.Words.IncorrectPasswordExceptionThe document is encrypted and requires a password to open, but you supplied an incorrect password.
T:System.ArgumentExceptionThe name of the file cannot be null or empty string.

◆ Document() [4/5]

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.

Parameters
streamStream where to load the document from.
Exceptions
T:Aspose.Words.UnsupportedFileFormatExceptionThe document format is not recognized or not supported.
T:Aspose.Words.FileCorruptedExceptionThe document appears to be corrupted and cannot be loaded.
T:System.ExceptionThere is a problem with the document and it should be reported to Aspose.Words developers.
T:System.IO.IOExceptionThere is an input/output exception.
T:Aspose.Words.IncorrectPasswordExceptionThe document is encrypted and requires a password to open, but you supplied an incorrect password.
T:System.ArgumentNullExceptionThe stream cannot be null.
T:System.NotSupportedExceptionThe stream does not support reading or seeking.
T:System.ObjectDisposedExceptionThe stream is a disposed object.

◆ Document() [5/5]

Aspose::Words::Document::Document ( System::SharedPtr< System::IO::Stream stream,
System::SharedPtr< Aspose::Words::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.

Parameters
streamThe stream where to load the document from.
loadOptionsAdditional options to use when loading a document. Can be null.
Exceptions
T:Aspose.Words.UnsupportedFileFormatExceptionThe document format is not recognized or not supported.
T:Aspose.Words.FileCorruptedExceptionThe document appears to be corrupted and cannot be loaded.
T:System.ExceptionThere is a problem with the document and it should be reported to Aspose.Words developers.
T:System.IO.IOExceptionThere is an input/output exception.
T:Aspose.Words.IncorrectPasswordExceptionThe document is encrypted and requires a password to open, but you supplied an incorrect password.
T:System.ArgumentNullExceptionThe stream cannot be null.
T:System.NotSupportedExceptionThe stream does not support reading or seeking.
T:System.ObjectDisposedExceptionThe stream is a disposed object.

Member Function Documentation

◆ Accept()

virtual bool Aspose::Words::Document::Accept ( System::SharedPtr< Aspose::Words::DocumentVisitor visitor)
virtual

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.

Parameters
visitorThe visitor that will visit the nodes.
Returns
True if all nodes were visited; false if DocumentVisitor stopped the operation before visiting all nodes.

Calls DocumentVisitor.VisitDocumentStart, then calls Accept for all child nodes of the document and calls DocumentVisitor.VisitDocumentEnd at the end.

Implements Aspose::Words::Node.

◆ AcceptAllRevisions()

void Aspose::Words::Document::AcceptAllRevisions ( )

Accepts all tracked changes in the document.

This method is a shortcut for Aspose::Words::RevisionCollection::AcceptAll.

◆ AppendDocument() [1/2]

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.

Parameters
srcDocThe document to append.
importFormatModeSpecifies how to merge style formatting that clashes.

◆ AppendDocument() [2/2]

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.

Parameters
srcDocThe document to append.
importFormatModeSpecifies how to merge style formatting that clashes.
importFormatOptionsAllows to specify options that affect formatting of a result document.

◆ Cleanup() [1/2]

void Aspose::Words::Document::Cleanup ( )

Cleans unused styles and lists from the document.

◆ Cleanup() [2/2]

void Aspose::Words::Document::Cleanup ( System::SharedPtr< Aspose::Words::CleanupOptions options)

Cleans unused styles and lists from the document depending on given Aspose::Words::CleanupOptions.

◆ ClearSectionAttrs()

void Aspose::Words::Document::ClearSectionAttrs ( )

◆ Clone()

System::SharedPtr<Aspose::Words::Document> Aspose::Words::Document::Clone ( )

Performs a deep copy of the Aspose::Words::Document.

Returns
The cloned document.

◆ Compare() [1/2]

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 Aspose::Words::Revision.

Parameters
documentDocument to compare.
authorInitials of the author to use for revisions.
dateTimeThe date and time to use for revisions.

The following document nodes are not compared at the moment:

Note
Documents must not have revisions before comparison.

◆ Compare() [2/2]

void Aspose::Words::Document::Compare ( System::SharedPtr< Aspose::Words::Document document,
System::String  author,
System::DateTime  dateTime,
System::SharedPtr< Aspose::Words::CompareOptions options 
)

Compares this document with another document producing changes as a number of edit and format revisions Aspose::Words::Revision. Allows to specify comparison options using Aspose::Words::CompareOptions.

◆ CopyStylesFromTemplate() [1/2]

void Aspose::Words::Document::CopyStylesFromTemplate ( System::String  template_)

Copies styles from the specified template to a document.

When styles are copied from a template to a document, like-named styles in the document are redefined to match the style descriptions in the template. Unique styles from the template are copied to the document. Unique styles in the document remain intact.

◆ CopyStylesFromTemplate() [2/2]

void Aspose::Words::Document::CopyStylesFromTemplate ( System::SharedPtr< Aspose::Words::Document template_)

Copies styles from the specified template to a document.

When styles are copied from a template to a document, like-named styles in the document are redefined to match the style descriptions in the template. Unique styles from the template are copied to the document. Unique styles in the document remain intact.

◆ EnsureMinimum()

void Aspose::Words::Document::EnsureMinimum ( )

If the document contains no sections, creates one section with one paragraph.

◆ ExpandTableStylesToDirectFormatting()

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:

  • Table styles defined in DOCX or WordprocessingML documents are preserved as table styles when saving the document as DOCX or WordprocessingML.

  • Table styles defined in DOCX or WordprocessingML documents are automatically converted to direct formatting on tables when saving the document into any other format, rendering or printing.

  • Table styles defined in DOC documents are preserved as table styles when saving the document as DOC only.

◆ FetchInheritedSectionAttr()

System::SharedPtr<System::Object> Aspose::Words::Document::FetchInheritedSectionAttr ( int32_t  key)

◆ FetchSectionAttr()

System::SharedPtr<System::Object> Aspose::Words::Document::FetchSectionAttr ( int32_t  key)

◆ get_AttachedTemplate()

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.

See also
Aspose::Words::Properties::BuiltInDocumentProperties::get_Template
Exceptions
T:System.ArgumentNullExceptionThrows if you attempt to set to a null value.

◆ get_AutomaticallyUpdateSyles()

bool Aspose::Words::Document::get_AutomaticallyUpdateSyles ( )

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.

◆ get_BuiltInDocumentProperties()

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.

◆ get_CompatibilityOptions()

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).

◆ get_Compliance()

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 Aspose::Words::Saving::OoxmlCompliance::Ecma376_2006 value.

◆ get_CustomDocumentProperties()

System::SharedPtr<Aspose::Words::Properties::CustomDocumentProperties> Aspose::Words::Document::get_CustomDocumentProperties ( ) const

Returns a collection that represents all the custom document properties of the document.

◆ get_CustomXmlParts()

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.

See also
Aspose::Words::Markup::CustomXmlPart

◆ get_DefaultTabStop()

double Aspose::Words::Document::get_DefaultTabStop ( )

Gets or sets the interval (in points) between the default tab stops.

See also
Aspose::Words::TabStopCollection, Aspose::Words::TabStop

◆ get_EndnoteOptions()

System::SharedPtr<Aspose::Words::EndnoteOptions> Aspose::Words::Document::get_EndnoteOptions ( )

Provides options that control numbering and positioning of endnotes in this document.

◆ get_FieldOptions()

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.

◆ get_FirstSection()

System::SharedPtr<Aspose::Words::Section> Aspose::Words::Document::get_FirstSection ( )

Gets the first section in the document.

Returns null if there are no sections.

◆ get_FontSettings()

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 Aspose::Words::Fonts::FontSettings::get_DefaultInstance will be used.

The default value is null.

◆ get_FootnoteOptions()

System::SharedPtr<Aspose::Words::FootnoteOptions> Aspose::Words::Document::get_FootnoteOptions ( )

Provides options that control numbering and positioning of footnotes in this document.

◆ get_GlossaryDocument()

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 Aspose::Words::BuildingBlocks::GlossaryDocument object and assigning to this property.

See also
Aspose::Words::BuildingBlocks::GlossaryDocument

◆ get_HasMacros()

bool Aspose::Words::Document::get_HasMacros ( )

Returns true if the document has a VBA project (macros).

See also
Aspose::Words::Document::RemoveMacros

◆ get_HasRevisions()

bool Aspose::Words::Document::get_HasRevisions ( )

Returns true if the document has any tracked changes.

This property is a shortcut for comparing Aspose::Words::RevisionCollection::get_Count to zero.

◆ get_HyphenationOptions()

System::SharedPtr<Aspose::Words::Settings::HyphenationOptions> Aspose::Words::Document::get_HyphenationOptions ( )

Provides access to document hyphenation options.

◆ get_LastSection()

System::SharedPtr<Aspose::Words::Section> Aspose::Words::Document::get_LastSection ( )

Gets the last section in the document.

Returns null if there are no sections.

◆ get_LayoutOptions()

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.

◆ get_MailMerge()

System::SharedPtr<Aspose::Words::MailMerging::MailMerge> Aspose::Words::Document::get_MailMerge ( )

Returns a MailMerge object that represents the mail merge functionality for the document.

◆ get_MailMergeSettings()

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.

◆ get_NodeType()

virtual Aspose::Words::NodeType Aspose::Words::Document::get_NodeType ( ) const
virtual

Returns NodeType.Document.

Implements Aspose::Words::Node.

◆ get_OriginalFileName()

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.

◆ get_OriginalLoadFormat()

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 Aspose::Words::LoadFormat::Doc value.

◆ get_PackageCustomParts()

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 Aspose::Words::Document::get_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 Aspose::Words::Markup::CustomPart.

Aspose.Words loads and saves custom parts into OOXML documents only.

This property cannot be null.

See also
Aspose::Words::Markup::CustomPart

◆ get_PageCount()

int32_t Aspose::Words::Document::get_PageCount ( )

Gets the number of pages in the document as calculated by the most recent page layout operation.

See also
Aspose::Words::Document::UpdatePageLayout

◆ get_ProtectionType()

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 Aspose::Words::Document::Protect(Aspose::Words::ProtectionType, System::String) and Aspose::Words::Document::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 Aspose::Words::Document::get_WriteProtection

See also
Aspose::Words::Document::Protect(Aspose::Words::ProtectionType, System::String), Aspose::Words::Document::Unprotect, Aspose::Words::Document::get_WriteProtection

◆ get_RemovePersonalInformation()

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.

◆ get_Revisions()

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.

◆ get_Sections()

System::SharedPtr<Aspose::Words::SectionCollection> Aspose::Words::Document::get_Sections ( )

Returns a collection that represents all sections in the document.

◆ get_ShadeFormData()

bool Aspose::Words::Document::get_ShadeFormData ( )

Specifies whether to turn on the gray shading on form fields.

◆ get_Theme()

System::SharedPtr<Aspose::Words::Themes::Theme> Aspose::Words::Document::get_Theme ( )

Gets the Aspose::Words::Document::get_Theme object for this document.

◆ get_TrackRevisions()

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 Aspose::Words::Document::StartTrackRevisions(System::String, System::DateTime) method.

◆ get_Variables()

System::SharedPtr<Aspose::Words::VariableCollection> Aspose::Words::Document::get_Variables ( )

Returns the collection of variables added to a document or template.

◆ get_VbaProject()

System::SharedPtr<Aspose::Words::VbaProject> Aspose::Words::Document::get_VbaProject ( )

Gets Aspose::Words::Document::get_VbaProject containing in the document.

◆ get_VersionsCount()

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.

◆ get_ViewOptions()

System::SharedPtr<Aspose::Words::Settings::ViewOptions> Aspose::Words::Document::get_ViewOptions ( )

Provides options to control how the document is displayed in Microsoft Word.

◆ get_WriteProtection()

System::SharedPtr<Aspose::Words::Settings::WriteProtection> Aspose::Words::Document::get_WriteProtection ( )

Provides access to the document write protection options.

◆ GetDirectSectionAttr()

System::SharedPtr<System::Object> Aspose::Words::Document::GetDirectSectionAttr ( int32_t  key)

◆ GetPageInfo()

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.

Parameters
pageIndexThe 0-based page index.

◆ JoinRunsWithSameFormatting()

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 Aspose::Words::Paragraph node in the document for adjacent Aspose::Words::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.

Returns
Number of joins performed. When N adjacent runs are being joined they count as N - 1 joins.

◆ NormalizeFieldTypes()

void Aspose::Words::Document::NormalizeFieldTypes ( )

Changes field type values Aspose::Words::Fields::FieldChar::get_FieldType of Aspose::Words::Fields::FieldStart, Aspose::Words::Fields::FieldSeparator, Aspose::Words::Fields::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 Aspose::Words::Range::NormalizeFieldTypes.

◆ Protect() [1/2]

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.

Parameters
typeSpecifies the protection type for the document.

◆ Protect() [2/2]

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 Aspose::Words::Document::get_WriteProtection.

Parameters
typeSpecifies the protection type for the document.
passwordThe password to protect the document with. Specify null or empty string if you want to protect the document without a password.

◆ RemoveExternalSchemaReferences()

void Aspose::Words::Document::RemoveExternalSchemaReferences ( )

Removes external XML schema references from this document.

◆ RemoveMacros()

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.

◆ RenderToScale()

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 System::Drawing::Graphics object to a specified scale.

Parameters
pageIndexThe 0-based page index.
graphicsThe object where to render to.
xThe X coordinate (in world units) of the top left corner of the rendered page.
yThe Y coordinate (in world units) of the top left corner of the rendered page.
scaleThe scale for rendering the page (1.0 is 100%).
Returns
The width and height (in world units) of the rendered page.

◆ RenderToSize()

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 System::Drawing::Graphics object to a specified size.

Parameters
pageIndexThe 0-based page index.
graphicsThe object where to render to.
xThe X coordinate (in world units) of the top left corner of the rendered page.
yThe Y coordinate (in world units) of the top left corner of the rendered page.
widthThe maximum width (in world units) that can be occupied by the rendered page.
heightThe maximum height (in world units) that can be occupied by the rendered page.
Returns
The scale that was automatically calculated for the rendered page to fit the specified size.

◆ Save() [1/5]

Saves the document to a file. Automatically determines the save format from the extension.

Parameters
fileNameThe name for the document. If a document with the specified file name already exists, the existing document is overwritten.
Returns
Additional information that you can optionally use.

◆ Save() [2/5]

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.

Parameters
fileNameThe name for the document. If a document with the specified file name already exists, the existing document is overwritten.
saveFormatThe format in which to save the document.
Returns
Additional information that you can optionally use.

◆ Save() [3/5]

Saves the document to a file using the specified save options.

Parameters
fileNameThe name for the document. If a document with the specified file name already exists, the existing document is overwritten.
saveOptionsSpecifies the options that control how the document is saved. Can be null.
Returns
Additional information that you can optionally use.

◆ Save() [4/5]

Saves the document to a stream using the specified format.

Parameters
streamStream where to save the document.
saveFormatThe format in which to save the document.
Returns
Additional information that you can optionally use.

◆ Save() [5/5]

Saves the document to a stream using the specified save options.

Parameters
streamStream where to save the document.
saveOptionsSpecifies 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.
Returns
Additional information that you can optionally use.

◆ set_AttachedTemplate()

void Aspose::Words::Document::set_AttachedTemplate ( System::String  value)

◆ set_AutomaticallyUpdateSyles()

void Aspose::Words::Document::set_AutomaticallyUpdateSyles ( bool  value)

◆ set_CustomXmlParts()

void Aspose::Words::Document::set_CustomXmlParts ( System::SharedPtr< Aspose::Words::Markup::CustomXmlPartCollection value)

◆ set_DefaultTabStop()

void Aspose::Words::Document::set_DefaultTabStop ( double  value)

◆ set_FontSettings()

void Aspose::Words::Document::set_FontSettings ( System::SharedPtr< Aspose::Words::Fonts::FontSettings value)

◆ set_GlossaryDocument()

void Aspose::Words::Document::set_GlossaryDocument ( System::SharedPtr< Aspose::Words::BuildingBlocks::GlossaryDocument value)

◆ set_MailMergeSettings()

void Aspose::Words::Document::set_MailMergeSettings ( System::SharedPtr< Aspose::Words::Settings::MailMergeSettings value)

◆ set_PackageCustomParts()

void Aspose::Words::Document::set_PackageCustomParts ( System::SharedPtr< Aspose::Words::Markup::CustomPartCollection value)

◆ set_RemovePersonalInformation()

void Aspose::Words::Document::set_RemovePersonalInformation ( bool  value)

◆ set_ShadeFormData()

void Aspose::Words::Document::set_ShadeFormData ( bool  value)

◆ set_TrackRevisions()

void Aspose::Words::Document::set_TrackRevisions ( bool  value)

◆ SetSectionAttr()

void Aspose::Words::Document::SetSectionAttr ( int32_t  key,
System::SharedPtr< System::Object value 
)

◆ StartTrackRevisions() [1/2]

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 Aspose::Words::DocumentBuilder

This method does not change the Aspose::Words::Document::get_TrackRevisions option and does not use its value for the purposes of revision tracking.

Parameters
authorInitials of the author to use for revisions.
dateTimeThe date and time to use for revisions.
See also
Aspose::Words::Document::StopTrackRevisions

◆ StartTrackRevisions() [2/2]

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 Aspose::Words::DocumentBuilder

This method does not change the Aspose::Words::Document::get_TrackRevisions option and does not use its value for the purposes of revision tracking.

Parameters
authorInitials of the author to use for revisions.
See also
Aspose::Words::Document::StopTrackRevisions

◆ StopTrackRevisions()

void Aspose::Words::Document::StopTrackRevisions ( )

Stops automatic marking of document changes as revisions.

See also
Aspose::Words::Document::StartTrackRevisions(System::String, System::DateTime)

◆ UnlinkFields()

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 Aspose::Words::Range::UnlinkFields.

◆ Unprotect() [1/2]

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 Aspose::Words::Document::get_WriteProtection.

◆ Unprotect() [2/2]

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 Aspose::Words::Document::get_WriteProtection.

Parameters
passwordThe password to unprotect the document with.
Returns
True if a correct password was specified and the document was unprotected.

◆ UpdateFields()

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 Aspose::Words::Document::UpdatePageLayout.

Use the Aspose::Words::Document::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 Aspose::Words::Range::UpdateFields.

◆ UpdateListLabels()

void Aspose::Words::Document::UpdateListLabels ( )

Updates list labels for all list items in the document.

This method updates list label properties such as Aspose::Words::Lists::ListLabel::get_LabelValue and Aspose::Words::Lists::ListLabel::get_LabelString for each Aspose::Words::Paragraph::get_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.

◆ UpdatePageLayout()

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 Aspose::Words::Document::UpdatePageLayout before rendering again.

◆ UpdateTableLayout()

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.

◆ UpdateThumbnail() [1/2]

void Aspose::Words::Document::UpdateThumbnail ( System::SharedPtr< Aspose::Words::Rendering::ThumbnailGeneratingOptions options)

Updates Aspose::Words::Properties::BuiltInDocumentProperties::get_Thumbnail of the document according to the specified options.

The Aspose::Words::Rendering::ThumbnailGeneratingOptions allows you to specify the source of thumbnail, size and other options. If attempt to generate thumbnail fails, doesn't change one.

Parameters
optionsThe generating options to use.

◆ UpdateThumbnail() [2/2]

void Aspose::Words::Document::UpdateThumbnail ( )

Updates Aspose::Words::Properties::BuiltInDocumentProperties::get_Thumbnail of the document using default options.

◆ UpdateWordCount() [1/2]

void Aspose::Words::Document::UpdateWordCount ( )

Updates word count properties of the document.

UpdateWordCount recalculates and updates Characters, Words and Paragraphs properties in the Aspose::Words::Document::get_BuiltInDocumentProperties collection of the Document.

Note that UpdateWordCount does not update number of lines and pages properties. Use the Aspose::Words::Document::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.

◆ UpdateWordCount() [2/2]

void Aspose::Words::Document::UpdateWordCount ( bool  updateLinesCount)

Updates word count properties of the document, optionally updates Aspose::Words::Properties::BuiltInDocumentProperties::get_Lines property.

This method will rebuild page layout of the document.

Parameters
updateLinesCountTrue if number of lines in the document shall be calculated.