Objeto MailMergeDataSource (Word)MailMergeDataSource object (Word)

Representa a fonte de dados da mala direta em uma operação de mala direta.Represents the mail merge data source in a mail merge operation.

ComentáriosRemarks

Use a propriedade DataSource para retornar o objeto MailMergeDataSource .Use the DataSource property to return the MailMergeDataSource object. O exemplo a seguir exibe o nome da fonte de dados associado ao documento ativo.The following example displays the name of the data source associated with the active document.

If ActiveDocument.MailMerge.DataSource.Name <> "" Then _ 
 MsgBox ActiveDocument.MailMerge.DataSource.Name

O exemplo a seguir exibe os nomes de campo na fonte de dados associada ao documento ativo.The following example displays the field names in the data source associated with the active document.

For Each aField In ActiveDocument.MailMerge.DataSource.FieldNames 
 MsgBox aField.Name 
Next aField

O exemplo a seguir abre a fonte de dados associada a Form letter.doc e determina se o campo FirstName inclui o nome "Kate".The following example opens the data source associated with Form letter.doc and determines whether the FirstName field includes the name "Kate."

With Documents("Form letter.doc").MailMerge 
 .EditDataSource 
 If .DataSource.FindRecord(FindText:="Kate", _ 
 Field:="FirstName") = True Then 
 MsgBox "Data was found" 
 End If 
End With

MétodosMethods

NomeName
CloseClose
FindRecordFindRecord
SetAllErrorFlagsSetAllErrorFlags
SetAllIncludedFlagsSetAllIncludedFlags

PropriedadesProperties

NomeName
ActiveRecordActiveRecord
ApplicationApplication
ConnectStringConnectString
CreatorCreator
DataFieldsDataFields
FieldNamesFieldNames
FirstRecordFirstRecord
HeaderSourceNameHeaderSourceName
HeaderSourceTypeHeaderSourceType
IncludedIncluded
InvalidAddressInvalidAddress
InvalidCommentsInvalidComments
LastRecordLastRecord
MappedDataFieldsMappedDataFields
NomeName
ParentParent
QueryStringQueryString
RecordCountRecordCount
TableNameTableName
TypeType

Ver tambémSee also

Referência do modelo de objeto do WordWord Object Model Reference