Table of contents
TOC
Collapse the table of content
Expand the table of content

MailMergeDataField.Insert Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Returns a Shape object that represents a data field inserted into a publication.

Syntax

expression. Insert( Range)

_expression_A variable that represents a MailMergeDataField object.

Parameters

NameRequired/OptionalData TypeDescription
RangeOptionalTextRangeThe text range to insert.

Return Value

Shape

Remarks

The Insert method works for both picture and string (text) fields.

Note You can also 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.

Example

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 the publication has been connected to a data source, and a catalog merge area has been added to the publication.

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
© 2018 Microsoft