OfficeDataSourceObject Object
Represents the mail merge data source in a mail merge operation.
Remarks
To work with the OfficeDataSourceObject object, dimension a variable as an OfficeDataSourceObject object. You can then work with the different properties and methods associated with the object. Use the SetSortOrder method to specify how to sort the records in a data source.
Example
The following example sorts the data source first according to Postal Code in descending order, then on last name and first name in ascending order.
| Visual Basic for Applications |
|---|
|
Use the Column, Comparison, CompareTo, and Conjunction properties to return or set the data source query criterion. The following example changes an existing filter to remove from the mail merge all records that do not have a Region field equal to "WA".
| Visual Basic for Applications |
|---|
|