Aspose::Words::Settings::MailMergeSettings Class Reference

Specifies all of the mail merge information for a document. More...

#include "Aspose.Words.Cpp/Model/Settings/MailMergeSettings.h"

Inherits System::Object.

Public Member Functions

int32_t get_ActiveRecord () const
 Specifies the one-based index of the record from the data source which shall be displayed in Microsoft Word. The default value is 1. More...
 
void set_ActiveRecord (int32_t value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_ActiveRecord. More...
 
System::String get_AddressFieldName () const
 Specifies the column within the data source that contains e-mail addresses. The default value is an empty string. More...
 
void set_AddressFieldName (System::String value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_AddressFieldName. More...
 
Aspose::Words::Settings::MailMergeCheckErrors get_CheckErrors () const
 Specifies the type of error reporting which shall be conducted by Microsoft Word when performing a mail merge. The default value is Aspose::Words::Settings::MailMergeCheckErrors::Default. More...
 
void set_CheckErrors (Aspose::Words::Settings::MailMergeCheckErrors value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_CheckErrors. More...
 
System::String get_ConnectString () const
 Specifies the connection string used to connect to an external data source. The default value is an empty string. More...
 
void set_ConnectString (System::String value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_ConnectString. More...
 
System::String get_DataSource () const
 Specifies the path to the mail-merge data source. The default value is an empty string. More...
 
void set_DataSource (System::String value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_DataSource. More...
 
Aspose::Words::Settings::MailMergeDataType get_DataType () const
 Specifies the type of the mail-merge data source and the method of data access. The default value is Aspose::Words::Settings::MailMergeDataType::Default. More...
 
void set_DataType (Aspose::Words::Settings::MailMergeDataType value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_DataType. More...
 
Aspose::Words::Settings::MailMergeDestination get_Destination () const
 Specifies how Microsoft Word will output the results of a mail merge. The default value is Aspose::Words::Settings::MailMergeDestination::Default. More...
 
void set_Destination (Aspose::Words::Settings::MailMergeDestination value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_Destination. More...
 
bool get_DoNotSupressBlankLines () const
 Specifies how an application performing the mail merge shall handle blank lines in the merged documents resulting from the mail merge. The default value is false. More...
 
void set_DoNotSupressBlankLines (bool value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_DoNotSupressBlankLines. More...
 
System::String get_HeaderSource () const
 Specifies the path to the mail-merge header source. The default value is an empty string. More...
 
void set_HeaderSource (System::String value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_HeaderSource. More...
 
bool get_LinkToQuery () const
 Not sure about this one. The Microsoft Word Automation Reference suggests that this specifies that the query is executed every time the document is opened in Microsoft Word. But the OOXML specification suggests that this specifies that the query contains a reference to an external query file which contains the actual query. The default value is false. More...
 
void set_LinkToQuery (bool value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_LinkToQuery. More...
 
bool get_MailAsAttachment () const
 Specifies that the documents produced during a mail merge operation should be emailed as an attachment rather than the body of the actual e-mail. The default value is false. More...
 
void set_MailAsAttachment (bool value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_MailAsAttachment. More...
 
System::String get_MailSubject () const
 Specifies the text which shall appear in the subject line of the e-mails or faxes produced during mail merge. The default value is an empty string. More...
 
void set_MailSubject (System::String value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_MailSubject. More...
 
Aspose::Words::Settings::MailMergeMainDocumentType get_MainDocumentType () const
 Specifies the mail-merge main document type. The default value is Aspose::Words::Settings::MailMergeMainDocumentType::Default. More...
 
void set_MainDocumentType (Aspose::Words::Settings::MailMergeMainDocumentType value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_MainDocumentType. More...
 
System::SharedPtr< Aspose::Words::Settings::Odsoget_Odso () const
 Gets or sets the object that specifies the Office Data Source Object (ODSO) settings. More...
 
void set_Odso (System::SharedPtr< Aspose::Words::Settings::Odso > value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_Odso. More...
 
System::String get_Query () const
 Contains the Structured Query Language string that shall be run against the specified external data source to return the set of records which shall be imported into the document when the mail merge operation is performed. The default value is an empty string. More...
 
void set_Query (System::String value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_Query. More...
 
bool get_ViewMergedData () const
 Specifies that Microsoft Word shall display the data from the specified external data source where merge fields have been inserted (e.g. preview merged data). The default value is false. More...
 
void set_ViewMergedData (bool value)
 Setter for Aspose::Words::Settings::MailMergeSettings::get_ViewMergedData. More...
 
void Clear ()
 Clears the mail merge settings in such a way that when the document is saved, no mail merge settings will be saved and it will become a normal document. More...
 
System::SharedPtr< Aspose::Words::Settings::MailMergeSettingsClone ()
 Returns a deep clone of this object. More...
 
 MailMergeSettings ()
 
- 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...
 

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

Detailed Description

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

You do not normally need to create objects of this class directly because Mail merge settings of a document are always available via the Aspose::Words::Document::get_MailMergeSettings property.

To detect whether this document is a mail merge main document, check the value of the Aspose::Words::Settings::MailMergeSettings::get_MainDocumentType property.

To remove mail merge settings and data source information from a document you can use the Aspose::Words::Settings::MailMergeSettings::Clear method. Aspose.Words will not write mail merge settings to a document if the Aspose::Words::Settings::MailMergeSettings::get_MainDocumentType property is set to Aspose::Words::Settings::MailMergeMainDocumentType::NotAMergeDocument or the Aspose::Words::Settings::MailMergeSettings::get_DataType property is set to Aspose::Words::Settings::MailMergeDataType::None.

The best way to learn how to use the properties of this object is to create a document with a desired data source manually in Microsoft Word and then open that document using Aspose.Words and examine the properties of the Aspose::Words::Document::get_MailMergeSettings and Aspose::Words::Settings::MailMergeSettings::get_Odso objects. This is a good approach to take if you want to learn how to programmatically configure a data source, for example.

Aspose.Words preserves mail merge information when loading, saving and converting documents between different formats, but does not use this information when performing its own mail merge using the Aspose::Words::MailMerging::MailMerge object.

See also
Aspose::Words::Document::get_MailMergeSettings

Constructor & Destructor Documentation

◆ MailMergeSettings()

Aspose::Words::Settings::MailMergeSettings::MailMergeSettings ( )

Member Function Documentation

◆ Clear()

void Aspose::Words::Settings::MailMergeSettings::Clear ( )

Clears the mail merge settings in such a way that when the document is saved, no mail merge settings will be saved and it will become a normal document.

◆ Clone()

System::SharedPtr<Aspose::Words::Settings::MailMergeSettings> Aspose::Words::Settings::MailMergeSettings::Clone ( )

Returns a deep clone of this object.

◆ get_ActiveRecord()

int32_t Aspose::Words::Settings::MailMergeSettings::get_ActiveRecord ( ) const

Specifies the one-based index of the record from the data source which shall be displayed in Microsoft Word. The default value is 1.

◆ get_AddressFieldName()

System::String Aspose::Words::Settings::MailMergeSettings::get_AddressFieldName ( ) const

Specifies the column within the data source that contains e-mail addresses. The default value is an empty string.

◆ get_CheckErrors()

Aspose::Words::Settings::MailMergeCheckErrors Aspose::Words::Settings::MailMergeSettings::get_CheckErrors ( ) const

Specifies the type of error reporting which shall be conducted by Microsoft Word when performing a mail merge. The default value is Aspose::Words::Settings::MailMergeCheckErrors::Default.

◆ get_ConnectString()

System::String Aspose::Words::Settings::MailMergeSettings::get_ConnectString ( ) const

Specifies the connection string used to connect to an external data source. The default value is an empty string.

◆ get_DataSource()

System::String Aspose::Words::Settings::MailMergeSettings::get_DataSource ( ) const

Specifies the path to the mail-merge data source. The default value is an empty string.

◆ get_DataType()

Aspose::Words::Settings::MailMergeDataType Aspose::Words::Settings::MailMergeSettings::get_DataType ( ) const

Specifies the type of the mail-merge data source and the method of data access. The default value is Aspose::Words::Settings::MailMergeDataType::Default.

◆ get_Destination()

Aspose::Words::Settings::MailMergeDestination Aspose::Words::Settings::MailMergeSettings::get_Destination ( ) const

Specifies how Microsoft Word will output the results of a mail merge. The default value is Aspose::Words::Settings::MailMergeDestination::Default.

◆ get_DoNotSupressBlankLines()

bool Aspose::Words::Settings::MailMergeSettings::get_DoNotSupressBlankLines ( ) const

Specifies how an application performing the mail merge shall handle blank lines in the merged documents resulting from the mail merge. The default value is false.

◆ get_HeaderSource()

System::String Aspose::Words::Settings::MailMergeSettings::get_HeaderSource ( ) const

Specifies the path to the mail-merge header source. The default value is an empty string.

◆ get_LinkToQuery()

bool Aspose::Words::Settings::MailMergeSettings::get_LinkToQuery ( ) const

Not sure about this one. The Microsoft Word Automation Reference suggests that this specifies that the query is executed every time the document is opened in Microsoft Word. But the OOXML specification suggests that this specifies that the query contains a reference to an external query file which contains the actual query. The default value is false.

◆ get_MailAsAttachment()

bool Aspose::Words::Settings::MailMergeSettings::get_MailAsAttachment ( ) const

Specifies that the documents produced during a mail merge operation should be emailed as an attachment rather than the body of the actual e-mail. The default value is false.

◆ get_MailSubject()

System::String Aspose::Words::Settings::MailMergeSettings::get_MailSubject ( ) const

Specifies the text which shall appear in the subject line of the e-mails or faxes produced during mail merge. The default value is an empty string.

◆ get_MainDocumentType()

Aspose::Words::Settings::MailMergeMainDocumentType Aspose::Words::Settings::MailMergeSettings::get_MainDocumentType ( ) const

Specifies the mail-merge main document type. The default value is Aspose::Words::Settings::MailMergeMainDocumentType::Default.

The main document is the document that contains information that is the same for each version of the merged document.

◆ get_Odso()

System::SharedPtr<Aspose::Words::Settings::Odso> Aspose::Words::Settings::MailMergeSettings::get_Odso ( ) const

Gets or sets the object that specifies the Office Data Source Object (ODSO) settings.

This object is never null.

◆ get_Query()

System::String Aspose::Words::Settings::MailMergeSettings::get_Query ( ) const

Contains the Structured Query Language string that shall be run against the specified external data source to return the set of records which shall be imported into the document when the mail merge operation is performed. The default value is an empty string.

◆ get_ViewMergedData()

bool Aspose::Words::Settings::MailMergeSettings::get_ViewMergedData ( ) const

Specifies that Microsoft Word shall display the data from the specified external data source where merge fields have been inserted (e.g. preview merged data). The default value is false.

◆ set_ActiveRecord()

void Aspose::Words::Settings::MailMergeSettings::set_ActiveRecord ( int32_t  value)

◆ set_AddressFieldName()

void Aspose::Words::Settings::MailMergeSettings::set_AddressFieldName ( System::String  value)

◆ set_CheckErrors()

void Aspose::Words::Settings::MailMergeSettings::set_CheckErrors ( Aspose::Words::Settings::MailMergeCheckErrors  value)

◆ set_ConnectString()

void Aspose::Words::Settings::MailMergeSettings::set_ConnectString ( System::String  value)

◆ set_DataSource()

void Aspose::Words::Settings::MailMergeSettings::set_DataSource ( System::String  value)

◆ set_DataType()

void Aspose::Words::Settings::MailMergeSettings::set_DataType ( Aspose::Words::Settings::MailMergeDataType  value)

◆ set_Destination()

void Aspose::Words::Settings::MailMergeSettings::set_Destination ( Aspose::Words::Settings::MailMergeDestination  value)

◆ set_DoNotSupressBlankLines()

void Aspose::Words::Settings::MailMergeSettings::set_DoNotSupressBlankLines ( bool  value)

◆ set_HeaderSource()

void Aspose::Words::Settings::MailMergeSettings::set_HeaderSource ( System::String  value)

◆ set_LinkToQuery()

void Aspose::Words::Settings::MailMergeSettings::set_LinkToQuery ( bool  value)

◆ set_MailAsAttachment()

void Aspose::Words::Settings::MailMergeSettings::set_MailAsAttachment ( bool  value)

◆ set_MailSubject()

void Aspose::Words::Settings::MailMergeSettings::set_MailSubject ( System::String  value)

◆ set_MainDocumentType()

void Aspose::Words::Settings::MailMergeSettings::set_MainDocumentType ( Aspose::Words::Settings::MailMergeMainDocumentType  value)

◆ set_Odso()

void Aspose::Words::Settings::MailMergeSettings::set_Odso ( System::SharedPtr< Aspose::Words::Settings::Odso value)

◆ set_Query()

void Aspose::Words::Settings::MailMergeSettings::set_Query ( System::String  value)

◆ set_ViewMergedData()

void Aspose::Words::Settings::MailMergeSettings::set_ViewMergedData ( bool  value)