How to edit CustomInfo of a Solidworks file using API

Hi,

Can anyone suggest a better way of editing the custom information of a SW file? My way is to delete the custom property and add it with a new value.

    retval = ModelDoc.DeleteCustomInfo2("", "Number")

    retval = ModelDoc.AddCustomInfo3("", "Number", 30, gen_form.txtNumber.Value)

Thanks

Michael

SolidworksApi macros