com.aspose.words
Class MailMergeCleanupOptions

java.lang.Object
    extended by com.aspose.words.MailMergeCleanupOptions

public class MailMergeCleanupOptions 
extends java.lang.Object

Utility class containing constants. Specifies options that determine what items are removed during mail merge.

Example:

Shows how to automatically remove unmerged merge fields during mail merge.
doc.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS);

Example:

Shows how to make sure empty paragraphs that result from merging fields with no data are removed from the document.
doc.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_EMPTY_PARAGRAPHS);

Example:

Shows how to instruct the mail merge engine to remove any containing fields from around a merge field during mail merge.
doc.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_CONTAINING_FIELDS);

Field Summary
static final intNONE = 0
           Specifies a default value.
static final intREMOVE_EMPTY_PARAGRAPHS = 1
           Specifies whether paragraphs that contained mail merge fields with no data should be removed from the document. When this option is set, paragraphs which contain region start and end merge fields which are otherwise empty are also removed.
static final intREMOVE_UNUSED_REGIONS = 2
           Specifies whether unused mail merge regions should be removed from the document. This option applies only to mail merge with regions.
static final intREMOVE_UNUSED_FIELDS = 4
           Specifies whether unused merge fields should be removed from the document.
static final intREMOVE_CONTAINING_FIELDS = 8
           Specifies whether fields that contain merge fields (for example, IFs) should be removed from the document if the nested merge fields are removed.
static final intREMOVE_STATIC_FIELDS = 16
           Specifies whether static fields should be removed from the document. Static fields are fields, which results remain the same upon any document change. Fields, which do not store their results in a document and are calculated on the fly (like FieldType.FIELD_LIST_NUM, FieldType.FIELD_SYMBOL, etc.) are not considered to be static.
 

Field Detail

NONE = 0

public static final int NONE
Specifies a default value.

REMOVE_EMPTY_PARAGRAPHS = 1

public static final int REMOVE_EMPTY_PARAGRAPHS
Specifies whether paragraphs that contained mail merge fields with no data should be removed from the document. When this option is set, paragraphs which contain region start and end merge fields which are otherwise empty are also removed.

REMOVE_UNUSED_REGIONS = 2

public static final int REMOVE_UNUSED_REGIONS
Specifies whether unused mail merge regions should be removed from the document. This option applies only to mail merge with regions.

REMOVE_UNUSED_FIELDS = 4

public static final int REMOVE_UNUSED_FIELDS
Specifies whether unused merge fields should be removed from the document.

REMOVE_CONTAINING_FIELDS = 8

public static final int REMOVE_CONTAINING_FIELDS
Specifies whether fields that contain merge fields (for example, IFs) should be removed from the document if the nested merge fields are removed.

REMOVE_STATIC_FIELDS = 16

public static final int REMOVE_STATIC_FIELDS
Specifies whether static fields should be removed from the document. Static fields are fields, which results remain the same upon any document change. Fields, which do not store their results in a document and are calculated on the fly (like FieldType.FIELD_LIST_NUM, FieldType.FIELD_SYMBOL, etc.) are not considered to be static. Here is the full list of field types, which are not considered to be static:

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.