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

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 MailMergeSettings property.

To detect whether this document is a mail merge main document, check the value of the MainDocumentType property.

To remove mail merge settings and data source information from a document you can use the Clear method. Aspose.Words will not write mail merge settings to a document if the MainDocumentType property is set to NotAMergeDocument or the DataType property is set to 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 MailMergeSettings and 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 MailMerge object.

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

#include <Aspose.Words.Cpp/Model/Settings/MailMergeSettings.h>

+ Inheritance diagram for Aspose::Words::Settings::MailMergeSettings:

Public Member Functions

 MailMergeSettings ()
 
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...
 
SharedPtr< MailMergeSettingsClone ()
 Returns a deep clone of this object. More...
 
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...
 
String get_AddressFieldName () const
 Specifies the column within the data source that contains e-mail addresses. The default value is an empty string. More...
 
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 Default. More...
 
String get_ConnectString () const
 Specifies the connection string used to connect to an external data source. The default value is an empty string. More...
 
String get_DataSource () const
 Specifies the path to the mail-merge data source. The default value is an empty string. More...
 
MailMergeDataType get_DataType () const
 Specifies the type of the mail-merge data source and the method of data access. The default value is Default. More...
 
MailMergeDestination get_Destination () const
 Specifies how Microsoft Word will output the results of a mail merge. The default value is Default. 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...
 
String get_HeaderSource () const
 Specifies the path to the mail-merge header source. The default value is an empty string. 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...
 
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...
 
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...
 
MailMergeMainDocumentType get_MainDocumentType () const
 Specifies the mail-merge main document type. The default value is Default. More...
 
SharedPtr< Odsoget_Odso () const
 Gets or sets the object that specifies the Office Data Source Object (ODSO) settings. More...
 
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...
 
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_ActiveRecord (int32_t value)
 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_AddressFieldName (String value)
 Specifies the column within the data source that contains e-mail addresses. The default value is an empty string. More...
 
void set_CheckErrors (MailMergeCheckErrors value)
 Setter for get_CheckErrors. More...
 
void set_ConnectString (String value)
 Specifies the connection string used to connect to an external data source. The default value is an empty string. More...
 
void set_DataSource (String value)
 Specifies the path to the mail-merge data source. The default value is an empty string. More...
 
void set_DataType (MailMergeDataType value)
 Setter for get_DataType. More...
 
void set_Destination (MailMergeDestination value)
 Setter for get_Destination. More...
 
void set_DoNotSupressBlankLines (bool value)
 Setter for get_DoNotSupressBlankLines. More...
 
void set_HeaderSource (String value)
 Setter for get_HeaderSource. More...
 
void set_LinkToQuery (bool value)
 Setter for get_LinkToQuery. More...
 
void set_MailAsAttachment (bool value)
 Setter for get_MailAsAttachment. More...
 
void set_MailSubject (String value)
 Setter for get_MailSubject. More...
 
void set_MainDocumentType (MailMergeMainDocumentType value)
 Setter for get_MainDocumentType. More...
 
void set_Odso (SharedPtr< Odso > value)
 Setter for get_Odso. More...
 
void set_Query (String value)
 Setter for get_Query. More...
 
void set_ViewMergedData (bool value)
 Setter for get_ViewMergedData. More...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

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

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

◆ set_AddressFieldName()

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

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

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

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

◆ set_DataSource()

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

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

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