MailMergeDataField.FieldType 属性 (Publisher)
返回一个 PbMailMergeDataFieldType 常量,该常量表示数据字段中包含的数据类型。
语法
表达式。FieldType
表达 一个代表 MailMergeDataField 对象的变量。
返回值
PbMailMergeDataFieldType
备注
使用 Insert 方法将图片数据字段添加到出版物的目录合并区域。
使用 TextRange 对象的 InsertMailMergeField 方法可在出版物的目录合并区中向文本框添加文本数据字段。
FieldType 属性值可以是在 Microsoft Publisher 类型库中声明的 PbMailMergeDataFieldType 常量之一。
示例
该示例将数据字段定义为图片数据字段,并将该字段插入到指定出版物的目录合并区中,然后调整图片数据字段的大小和位置。 该示例假定出版物已经连接到数据源,并且目录合并区已经添加到出版物中。
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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈