search/mag_sel search/close
Aspose::Words::Settings::MailMergeSettings Class Reference

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/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 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...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
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)
 Specifies the type of error reporting which shall be conducted by Microsoft Word when performing a mail merge. The default value is Default. 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)
 Specifies the type of the mail-merge data source and the method of data access. The default value is Default. More...
 
void set_Destination (MailMergeDestination value)
 Specifies how Microsoft Word will output the results of a mail merge. The default value is Default. More...
 
void set_DoNotSupressBlankLines (bool value)
 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_HeaderSource (String value)
 Specifies the path to the mail-merge header source. The default value is an empty string. More...
 
void set_LinkToQuery (bool value)
 Setter for get_LinkToQuery. More...
 
void set_MailAsAttachment (bool value)
 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_MailSubject (String value)
 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_MainDocumentType (MailMergeMainDocumentType value)
 Setter for get_MainDocumentType. More...
 
void set_Odso (SharedPtr< Odso > value)
 Sets the object that specifies the Office Data Source Object (ODSO) settings. More...
 
void set_Query (String value)
 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_ViewMergedData (bool value)
 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...
 

Static Public Member Functions

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

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Settings::MailMergeSettings::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Settings::MailMergeSettings::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

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

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

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

Specifies the type of the mail-merge data source and the method of data access. The default value is Default.

◆ set_Destination()

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

Specifies how Microsoft Word will output the results of a mail merge. The default value is Default.

◆ set_DoNotSupressBlankLines()

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

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.

◆ set_HeaderSource()

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

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

◆ set_LinkToQuery()

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

◆ set_MailAsAttachment()

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

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.

◆ set_MailSubject()

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

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.

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

Sets the object that specifies the Office Data Source Object (ODSO) settings.

This object is never null.

◆ set_Query()

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

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.

◆ set_ViewMergedData()

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

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.

◆ Type()

static const System::TypeInfo& Aspose::Words::Settings::MailMergeSettings::Type ( )
static