HELP? Has anyone else ever done this... by accedent?

Hi all!  I need help, please...

 

So I rencently needed to release a new set of file templates.  Our current templates had file properties with values already populated.  I wanted to assure that I cleared ALL file properties so I used API to loop they all Propsets and set all Prop vales to "" (nullset).

 

After a few days we have found this to be a very bad thing!!!  This loop also cleared the non-exposed Properties which are appearengly used...  Specfically now I can not find my drafts via a REV manager Where used from the part....  But from the part we see the assocaited Draft...

 

Has anyone every done this?  What was the fix / resolution?

 

To make matters worse we are using Insight... I have an IR open with GTAC and development is also looking int othe issue, but i'm hoing someone might have had similar experiance

 

For reference,  this is the loop I ran that was intended to only clear all values.  it appears however that if a property has no value it is removed?  still testing..

 

DO NOT RUN THIS CODE AGAINAST A FILE YOU NEED!!!!

 

Public Sub DeleteAllProperties()

        objDoc = objApp.ActiveDocument

        objpropsets = objDoc.Properties

        txtTitle.Text = ""

        objpropsets.Item("Custom").Add("Material_UPPER", "")

        On Error Resume Next

        For Each Me.objprops In objpropsets 'checks thru all property tabs

            If objprops.Name = "projectinformation" Then

                For Each Me.objprop In objprops 'checks thru project property tab

                    objprop.Value = ""

                Next objprop 'checks thru project property tab

            ElseIf objprops.Name = "summaryinformation" Then

                For Each Me.objprop In objprops 'checks thru Summary property tab

                    objprop.Value = ""

                Next objprop 'checks thru project property tab

            ElseIf objprops.Name = "extendedsummaryinformation" Then

                For Each Me.objprop In objprops 'checks thru Summary property tab

                    objprop.Value = ""

                Next objprop 'checks thru project property tab

            ElseIf objprops.Name = "documentsummaryinformation" Then

                For Each Me.objprop In objprops 'checks thru Summary property tab

                    objprop.Value = ""

                Next objprop 'checks thru project property tab

            ElseIf objprops.Name = "custom" Then

                For Each Me.objprop In objprops 'checks thru Custom property tab

                    objprop.Value = ""

                Next objprop 'checks thru project property tab

            End If

        Next objprops 'checks thru all property tabs

 

 

        objprops.Save()

 

    End Sub