I am calling GetCustomProperty with a property name that the part doesn't have and instead of returning null is crashing. The documentation doesn't say anything about the return value if the property doesn't exist. Do we need to call this method when we know the property exists?
string sCustPropStr = null;
SwDmCustomInfoType nPropType = 0;
sCustPropStr = swDoc.GetCustomProperty("MyProperty", out nPropType);
Please read the documentation again:
Remarks
This method returns the resolved evaluated values of custom properties prefaced with fromparent+ for external referenced documents. Use ISwDocument17::GetCustomProperty2 to return resolved evaluated values without the fromparent+ preface.
Before calling this method, call ISwDMDocument::GetCustomPropertyNames.