CatalogMergeItems Property

Microsoft Publisher Visual Basic

Show All Show All

CatalogMergeItems Property

Returns a CatalogMergeShapes collection that represents the shapes included in the catalog merge area. Read-only.

expression.CatalogMergeItems

expression   Required. An expression that returns a Shape object.

Remarks

The catalog merge area can contain picture and text data fields you have inserted, as well as other design elements you choose.

Example

The following example tests whether any page in the specified publication contains a catalog merge area, and if it does it returns a list of the shapes it contains.

    Sub ListCatalogMergeAreaContents()
 
    Dim pgPage As Page
    Dim mmLoop As Shape
    Dim intCount As Integer

    For Each pgPage In ThisDocument.Pages
        For Each mmLoop In pgPage.Shapes

            If mmLoop.Type = pbCatalogMergeArea Then

                With mmLoop.CatalogMergeItems
                    For intCount = 1 To .Count
                        Debug.Print "Shape ID: " & _
                            mmLoop.CatalogMergeItems.Item(intCount).ID
                        Debug.Print "Shape Name: " & _
                            mmLoop.CatalogMergeItems.Item(intCount).Name
                    Next
                End With

            End If

        Next mmLoop
    Next pgPage

End Sub