public class MailMergeSettings
extends java.lang.Object
implements java.lang.Cloneable
To learn more, visit the Mail Merge and Reporting documentation article.
Remarks:
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 Document.getMailMergeSettings() / Document.setMailMergeSettings(com.aspose.words.MailMergeSettings) property.
To detect whether this document is a mail merge main document, check the value of the getMainDocumentType() / setMainDocumentType(int) 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 getMainDocumentType() / setMainDocumentType(int) property is set to MailMergeMainDocumentType.NOT_A_MERGE_DOCUMENT or the getDataType() / setDataType(int) property is set to 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 Document.getMailMergeSettings() / Document.setMailMergeSettings(com.aspose.words.MailMergeSettings) and getOdso() / setOdso(com.aspose.words.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.
| Modifier and Type | Method and Description |
|---|---|
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.
|
MailMergeSettings |
deepClone()
Returns a deep clone of this object.
|
int |
getActiveRecord()
Specifies the one-based index of the record from the data source which shall be displayed in Microsoft Word.
|
java.lang.String |
getAddressFieldName()
Specifies the column within the data source that contains e-mail addresses.
|
int |
getCheckErrors()
Specifies the type of error reporting which shall be conducted by Microsoft Word when performing a mail merge.
|
java.lang.String |
getConnectString()
Specifies the connection string used to connect to an external data source.
|
java.lang.String |
getDataSource()
Specifies the path to the mail-merge data source.
|
int |
getDataType()
Specifies the type of the mail-merge data source and the method of data access.
|
int |
getDestination()
Specifies how Microsoft Word will output the results of a mail merge.
|
boolean |
getDoNotSupressBlankLines()
Specifies how an application performing the mail merge shall handle blank lines in the merged documents resulting from the mail merge.
|
java.lang.String |
getHeaderSource()
Specifies the path to the mail-merge header source.
|
boolean |
getLinkToQuery()
Not sure about this one.
|
boolean |
getMailAsAttachment()
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.
|
java.lang.String |
getMailSubject()
Specifies the text which shall appear in the subject line of the e-mails or faxes produced during mail merge.
|
int |
getMainDocumentType()
Specifies the mail-merge main document type.
|
Odso |
getOdso()
Gets the object that specifies the Office Data Source Object (ODSO) settings.
|
java.lang.String |
getQuery()
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.
|
boolean |
getViewMergedData()
Specifies that Microsoft Word shall display the data from the specified external data source where merge fields have been inserted (e.g.
|
protected java.lang.Object |
memberwiseClone() |
void |
setActiveRecord(int value)
Specifies the one-based index of the record from the data source which shall be displayed in Microsoft Word.
|
void |
setAddressFieldName(java.lang.String value)
Specifies the column within the data source that contains e-mail addresses.
|
void |
setCheckErrors(int value)
Specifies the type of error reporting which shall be conducted by Microsoft Word when performing a mail merge.
|
void |
setConnectString(java.lang.String value)
Specifies the connection string used to connect to an external data source.
|
void |
setDataSource(java.lang.String value)
Specifies the path to the mail-merge data source.
|
void |
setDataType(int value)
Specifies the type of the mail-merge data source and the method of data access.
|
void |
setDestination(int value)
Specifies how Microsoft Word will output the results of a mail merge.
|
void |
setDoNotSupressBlankLines(boolean value)
Specifies how an application performing the mail merge shall handle blank lines in the merged documents resulting from the mail merge.
|
void |
setHeaderSource(java.lang.String value)
Specifies the path to the mail-merge header source.
|
void |
setLinkToQuery(boolean value)
Not sure about this one.
|
void |
setMailAsAttachment(boolean 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.
|
void |
setMailSubject(java.lang.String value)
Specifies the text which shall appear in the subject line of the e-mails or faxes produced during mail merge.
|
void |
setMainDocumentType(int value)
Specifies the mail-merge main document type.
|
void |
setOdso(Odso value)
Sets the object that specifies the Office Data Source Object (ODSO) settings.
|
void |
setQuery(java.lang.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.
|
void |
setViewMergedData(boolean value)
Specifies that Microsoft Word shall display the data from the specified external data source where merge fields have been inserted (e.g.
|
public void clear()
public MailMergeSettings deepClone()
public int getActiveRecord()
int value.public void setActiveRecord(int value)
value - The corresponding int value.public java.lang.String getAddressFieldName()
String value.public void setAddressFieldName(java.lang.String value)
value - The corresponding String value.public int getCheckErrors()
MailMergeCheckErrors.DEFAULT.int value. The returned value is one of MailMergeCheckErrors constants.public void setCheckErrors(int value)
MailMergeCheckErrors.DEFAULT.value - The corresponding int value. The value must be one of MailMergeCheckErrors constants.public java.lang.String getConnectString()
String value.public void setConnectString(java.lang.String value)
value - The corresponding String value.public java.lang.String getDataSource()
String value.public void setDataSource(java.lang.String value)
value - The corresponding String value.public int getDataType()
MailMergeDataType.DEFAULT.int value. The returned value is one of MailMergeDataType constants.public void setDataType(int value)
MailMergeDataType.DEFAULT.value - The corresponding int value. The value must be one of MailMergeDataType constants.public int getDestination()
MailMergeDestination.DEFAULT.int value. The returned value is one of MailMergeDestination constants.public void setDestination(int value)
MailMergeDestination.DEFAULT.value - The corresponding int value. The value must be one of MailMergeDestination constants.public boolean getDoNotSupressBlankLines()
false.boolean value.public void setDoNotSupressBlankLines(boolean value)
false.value - The corresponding boolean value.public java.lang.String getHeaderSource()
String value.public void setHeaderSource(java.lang.String value)
value - The corresponding String value.public boolean getLinkToQuery()
false.boolean value.public void setLinkToQuery(boolean value)
false.value - The corresponding boolean value.public boolean getMailAsAttachment()
false.boolean value.public void setMailAsAttachment(boolean value)
false.value - The corresponding boolean value.public java.lang.String getMailSubject()
String value.public void setMailSubject(java.lang.String value)
value - The corresponding String value.public int getMainDocumentType()
MailMergeMainDocumentType.DEFAULT.
Remarks:
The main document is the document that contains information that is the same for each version of the merged document.
int value. The returned value is one of MailMergeMainDocumentType constants.public void setMainDocumentType(int value)
MailMergeMainDocumentType.DEFAULT.
Remarks:
The main document is the document that contains information that is the same for each version of the merged document.
value - The corresponding int value. The value must be one of MailMergeMainDocumentType constants.public Odso getOdso()
Remarks:
This object is never null.
public void setOdso(Odso value)
Remarks:
This object is never null.
value - The object that specifies the Office Data Source Object (ODSO) settings.public java.lang.String getQuery()
String value.public void setQuery(java.lang.String value)
value - The corresponding String value.public boolean getViewMergedData()
false.boolean value.public void setViewMergedData(boolean value)
false.value - The corresponding boolean value.protected java.lang.Object memberwiseClone()