Delete ISO content

Created:7/1/2002
Description:

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.

NOTE: this macro doesn't verify that the selected object supports metadata, whether it already has metadata, or whether the metadata is writable. For an example of how this is accomplished, look at the function HasWritableMD in the CheckMD module provided with the Metadata Spellchecker sample.


How to use:
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