AnsweredAssumed Answered

PDMWorkgroup API to add custom properties

Question asked by Kevin Vaughan on Nov 23, 2009
Latest reply on Nov 23, 2009 by Jiral Parikh

I want to add several properties to all (most) files in the vault I have tried the following code

conditions

***  res is a search reult  listing files I want to change

*** New props is the list of new proerties I want to add

 

It runs without error but the new properties are not present in the vault, they do apear to be added if I single step through the add/update lines, but after the subroutine ends, the file does not have the new properties.  Any suggestions?

 

 

For Each r In res
            If r.Document.Owner = "" And UCase(Strings.Right(r.Document.Name, 3)) <> "DRW" Then

                r.Document.TakeOwnership()

                props = r.Document.Properties
                For i = 0 To 5

                    hres = props.Add(NewProps(i))
                    hres = props.Update()
                Next

             

 

                r.Document.ReleaseOwnership()
            End If

        Next

Outcomes