<?xml encoding=”UTF-8″>By Adam Nagy
If you ended up with features in your iPart factory which are suppressed in each iPart member then you could delete those like this:
Sub DeleteSuppressedFeatures()
' Open the iPart Factory document before
' running this
Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument
Dim fact As iPartFactory
Set fact = doc.ComponentDefinition.iPartFactory
Dim col As iPartTableColumn
For Each col In fact.TableColumns
' If the column is about suppression
If col.ReferencedDataType = kExclusionColumn Then
Dim del As Boolean: del = True
Dim cell As iPartTableCell
For Each cell In col
' If it's not suppressed in each row
' then we won't delete it
If cell.value <> "Suppress" Then
del = False
Exit For
End If
Next
If del Then
col.ReferencedObject.Delete
End If
End If
Next
End Sub

Leave a Reply