MailMergeDataField.Insert 方法 (Publisher)

返回一个 Shape 对象,该对象代表插入出版物的数据域。

语法

表达式插入 (范围)

表达 一个代表 MailMergeDataField 对象的变量。

参数

名称 必需/可选 数据类型 说明
Range 可选 TextRange 要插入的文本范围。

返回值

Shape

说明

两个 插入 方法的效果图片和字符串 (文本) 字段。

注意

还可以使用 TextRange 对象的 InsertMailMergeField 方法将文本数据字段添加到出版物目录合并区域中的文本框中。

示例

本示例将一个数据域定义为图片数据域,将其插入到指定出版物的目录合并区,并调整该图片数据域的尺寸和位置。 此示例假定出版物已连接到数据源,并且已将目录合并区域添加到出版物。

Dim pbPictureField1 As Shape 
 
 'Define the field as a picture data type 
 With ThisDocument.MailMerge.DataSource.DataFields 
 .Item("Photo:").FieldType = pbMailMergeDataFieldPicture 
 End With 
 
 'Insert a picture field, and 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。