java.lang.Objectcom.aspose.words.MailMergeSettings
public class MailMergeSettings
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 To detect whether this document is a mail merge main document, check the value of the
To remove mail merge settings and data source information from a document you can use the
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 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
Constructor Summary |
---|
MailMergeSettings()
Initializes a new instance of this class. |
Property Getters/Setters Summary | ||
---|---|---|
int | getActiveRecord() | |
void | setActiveRecord(int 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. | ||
java.lang.String | getAddressFieldName() | |
void | setAddressFieldName(java.lang.String value) | |
Specifies the column within the data source that contains e-mail addresses. The default value is an empty string. | ||
int | getCheckErrors() | |
void | setCheckErrors(int value) | |
Specifies the type of error reporting which shall be conducted by Microsoft Word when performing a mail merge.
The default value is |
||
java.lang.String | getConnectString() | |
void | setConnectString(java.lang.String value) | |
Specifies the connection string used to connect to an external data source. The default value is an empty string. | ||
java.lang.String | getDataSource() | |
void | setDataSource(java.lang.String value) | |
Specifies the path to the mail-merge data source. The default value is an empty string. | ||
int | getDataType() | |
void | setDataType(int value) | |
Specifies the type of the mail-merge data source and the method of data access.
The default value is |
||
int | getDestination() | |
void | setDestination(int value) | |
Specifies how Microsoft Word will output the results of a mail merge.
The default value is |
||
boolean | getDoNotSupressBlankLines() | |
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.
The default value is false .
|
||
java.lang.String | getHeaderSource() | |
void | setHeaderSource(java.lang.String value) | |
Specifies the path to the mail-merge header source. The default value is an empty string. | ||
boolean | getLinkToQuery() | |
void | setLinkToQuery(boolean value) | |
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 .
|
||
boolean | getMailAsAttachment() | |
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. The default value is false .
|
||
java.lang.String | getMailSubject() | |
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. The default value is an empty string. | ||
int | getMainDocumentType() | |
void | setMainDocumentType(int value) | |
Specifies the mail-merge main document type.
The default value is |
||
Odso | getOdso() | |
void | setOdso(Odso value) | |
Gets or sets the object that specifies the Office Data Source Object (ODSO) settings. | ||
java.lang.String | getQuery() | |
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. The default value is an empty string. | ||
boolean | getViewMergedData() | |
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. preview merged data). The default value is false .
|
Method Summary | ||
---|---|---|
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. |
Constructor Detail |
---|
public MailMergeSettings()
Property Getters/Setters Detail |
---|
getActiveRecord/setActiveRecord | |
public int getActiveRecord() / public void setActiveRecord(int value) |
getAddressFieldName/setAddressFieldName | |
public java.lang.String getAddressFieldName() / public void setAddressFieldName(java.lang.String value) |
getCheckErrors/setCheckErrors | |
public int getCheckErrors() / public void setCheckErrors(int value) |
getConnectString/setConnectString | |
public java.lang.String getConnectString() / public void setConnectString(java.lang.String value) |
getDataSource/setDataSource | |
public java.lang.String getDataSource() / public void setDataSource(java.lang.String value) |
getDataType/setDataType | |
public int getDataType() / public void setDataType(int value) |
getDestination/setDestination | |
public int getDestination() / public void setDestination(int value) |
getDoNotSupressBlankLines/setDoNotSupressBlankLines | |
public boolean getDoNotSupressBlankLines() / public void setDoNotSupressBlankLines(boolean value) |
false
.
getHeaderSource/setHeaderSource | |
public java.lang.String getHeaderSource() / public void setHeaderSource(java.lang.String value) |
getLinkToQuery/setLinkToQuery | |
public boolean getLinkToQuery() / public void setLinkToQuery(boolean value) |
false
.
getMailAsAttachment/setMailAsAttachment | |
public boolean getMailAsAttachment() / public void setMailAsAttachment(boolean value) |
false
.
getMailSubject/setMailSubject | |
public java.lang.String getMailSubject() / public void setMailSubject(java.lang.String value) |
getMainDocumentType/setMainDocumentType | |
public int getMainDocumentType() / public void setMainDocumentType(int value) |
The main document is the document that contains information that is the same for each version of the merged document.
getOdso/setOdso | |
public Odso getOdso() / public void setOdso(Odso value) |
This object is never null.
getQuery/setQuery | |
public java.lang.String getQuery() / public void setQuery(java.lang.String value) |
getViewMergedData/setViewMergedData | |
public boolean getViewMergedData() / public void setViewMergedData(boolean value) |
false
.
Method Detail |
---|
clear | |
public void clear() |
deepClone | |
public MailMergeSettings deepClone() |