Shape.RemoveFromCatalogMergeArea Method

Publisher Developer Reference

Removes a shape from the specified page's catalog merge area. Removed shapes are not deleted, but instead remain in place on the page containing the catalog merge area.

Syntax

expression.RemoveFromCatalogMergeArea

expression   A variable that represents a Shape object.

Return Value
Nothing

Remarks

Use the AddToCatalogMergeArea method of the Shape or ShapeRange objects to add shapes to a catalog merge area.

Use the RemoveCatalogMergeArea method of the Shape object to remove the catalog merge area from a publication page, but leave the shapes it contains.

Example

The following example tests whether any page of the specified publication contains a catalog merge area. If any page does, all the shapes are removed from the catalog merge area and deleted, and the catalog merge area is then removed from the publication.

Visual Basic for Applications
  Sub DeleteCatalogMergeAreaAndAllShapesWithin()
    Dim pgPage As Page
    Dim mmLoop As Shape
    Dim intCount As Integer
    Dim strName As String
    
        For Each pgPage In ThisDocument.Pages
            For Each mmLoop In pgPage.Shapes
            
                If mmLoop.Type = pbCatalogMergeArea Then
                    With mmLoop.CatalogMergeItems
                        For intCount = .Count To 1 Step -1
                            strName = mmLoop.CatalogMergeItems.Item(intCount).Name
                            .Item(intCount).RemoveFromCatalogMergeArea
                            pgPage.Shapes(strName).Delete
                        Next
                    End With
                mmLoop.RemoveCatalogMergeArea
                End If
                
            Next mmLoop
        Next pgPage
       
 End Sub

See Also