Table of contents
TOC
折叠目录
展开目录

MailMergeDataSource.SetSortOrder 方法 (发布服务器)MailMergeDataSource.SetSortOrder Method (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
3 参与人员

设置邮件合并数据的排序顺序。Sets the sort order for mail merge data.

语法Syntax

表达式SetSortOrderSortField1SortAscending1SortField2SortAscending2SortField3SortAscending3expression. SetSortOrder( SortField1, SortAscending1, SortField2, SortAscending2, SortField3, SortAscending3)

_expression_A 表示MailMergeDataSource对象的变量。_expression_A variable that represents a MailMergeDataSource object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
SortField1SortField1可选OptionalStringString排序邮件合并数据所依据的第一个字段。默认值为空字符串。The first field on which to sort the mail merge data. Default is an empty string.
SortAscending1SortAscending1可选OptionalBooleanBoolean(默认值),SortField1; 在执行升序排序进行降序排序。True (default) to perform an ascending sort on SortField1; False to perform a descending sort.
SortField2SortField2可选OptionalStringString排序邮件合并数据所依据的第二个字段。默认为空字符串。The second field on which to sort the mail merge data. Default is an empty string.
SortAscending2SortAscending2可选OptionalBooleanBoolean(默认值),SortField2; 在执行升序排序进行降序排序。True (default) to perform an ascending sort on SortField2; False to perform a descending sort.
SortField3SortField3可选OptionalStringString排序邮件合并数据依据的第三个字段。默认为空字符串。The third field on which to sort the mail merge data. Default is an empty string.
SortAscending3SortAscending3可选OptionalBooleanBoolean(默认值),SortField3; 在执行升序排序进行降序排序。True (default) to perform an ascending sort on SortField3; False to perform a descending sort.

示例Example

以下示例首先将邮件合并数据按邮政编码的降序排序,再按姓氏和名字的升序排序。The following example sorts mail merge data first on postal code in descending order, then on last name and first name in ascending order.

ActiveDocument.MailMerge.DataSource.SetSortOrder _ 
 SortField1:="ZIPCode", SortAscending1:=False, _ 
 SortField2:="LastName", SortField3:="FirstName"
© 2018 Microsoft