共用方式為


Publisher) (MailMergeDataField.Insert 方法

會傳回 Shape 物件,代表插入至出版物的資料欄位。

語法

運算式插入 (範圍)

表達 代表 MailMergeDataField 物件的 變數。

參數

名稱 必要/選用 資料類型 描述
Range 選用 TextRange 要插入的文字範圍。

傳回值

圖形

註解

Insert 方法適用於圖片及字串 (文字) 欄位。

注意事項

您也可以使用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 支援與意見反應