How to delete ISO content


This tip demonstrates how to remove all ISO-related metadata content from a metadata record while leaving any thumbnails, enclosures, or other metadata content intact.
This macro doesn't verify that the selected object supports metadata, whether it already has metadata, or whether the metadata is writable.

How to use

  1. Paste this macro into VBA.
  2. Select an object in ArcCatalog that has metadata.
  3. Run the macro.
[VBA]
Sub DeleteISOContent()
    
    Dim pGxApp As IGxApplication
    Dim pGxView As IGxView
    Dim pMD As IMetadata
    Dim pPS As IPropertySet
    Dim dNow As Date
    
    Set pGxApp = Application
    Set pMD = pGxApp.SelectedObject
    Set pPS = pMD.Metadata
    
    pPS.RemoveProperty "mdFileID"
    pPS.RemoveProperty "mdLang"
    pPS.RemoveProperty "mdChar"
    pPS.RemoveProperty "mdParentID"
    pPS.RemoveProperty "mdHrLv"
    pPS.RemoveProperty "mdHrLvName"
    pPS.RemoveProperty "mdContact"
    pPS.RemoveProperty "mdDateSt"
    pPS.RemoveProperty "mdStanName"
    pPS.RemoveProperty "mdStanVer"
    pPS.RemoveProperty "distInfo"
    pPS.RemoveProperty "dataIdInfo"
    pPS.RemoveProperty "appSchInfo"
    pPS.RemoveProperty "porCatInfo"
    pPS.RemoveProperty "mdMaint"
    pPS.RemoveProperty "mdConst"
    pPS.RemoveProperty "dqInfo"
    pPS.RemoveProperty "spatRepInfo"
    pPS.RemoveProperty "refSysInfo"
    pPS.RemoveProperty "contInfo"
    pPS.RemoveProperty "mdExtInfo"
    
    dNow = Now
    pPS.SetProperty "Esri/ModDate", Format(dNow, "yyyymmdd")
    pPS.SetProperty "Esri/ModTime", Format(dNow, "HhNnSs") & "00"
    pMD.Metadata = pPS
    
    Set pGxView = pGxApp.View
    If TypeOf pGxView Is IGxDocumentationView Then
        pGxView.Refresh
    End If
    
End Sub