MailMergeDataField 属性 (Publisher)MailMergeDataField.FieldType property (Publisher)

返回一个**PbMailMergeDataFieldType** 常量, 该常量代表数据字段中包含的数据的类型。Returns a PbMailMergeDataFieldType constant that represents the type of data contained in the data field.



_表达式_一个代表**MailMergeDataField** 对象的变量。expression A variable that represents a MailMergeDataField object.

返回值Return value



使用**Insert** 方法可将图片数据字段添加到出版物的目录合并区。Use the Insert method to add a picture data field to a publication's catalog merge area.

使用 TextRange 对象的 InsertMailMergeField 方法可在出版物的目录合并区中向文本框添加文本数据字段。Use the InsertMailMergeField method of the TextRange object to add a text data field to a text box in the publication's catalog merge area.

FieldType属性值可以是在 Microsoft 发布服务器类型库中声明的PbMailMergeDataFieldType常量之一。The FieldType property value can be one of the PbMailMergeDataFieldType constants declared in the Microsoft Publisher type library.


该示例将数据字段定义为图片数据字段,并将该字段插入到指定出版物的目录合并区中,然后调整图片数据字段的大小和位置。This example defines a data field as a picture data field, inserts it into the catalog merge area of the specified publication, and sizes and positions the picture data field. 该示例假定出版物已经连接到数据源,并且目录合并区已经添加到出版物中。This example assumes that the publication has been connected to a data source, and that a catalog merge area has been added to the publication.

Dim pbPictureField1 As Shape 
 'Define the Photo field as a picture data type 
 With ThisDocument.MailMerge.DataSource.DataFields 
 .Item("Photo:").FieldType = pbMailMergeDataFieldPicture 
 End With 
 'Insert a picture field, then size and position it 
 Set pbPictureField1 = ThisDocument.MailMerge.DataSource.DataFields.Item("Photo:").Insert 
 With pbPictureField1 
 .Height = 100 
 .Width = 100 
 .Top = 85 
 .Left = 375 
 End With

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.