Well, I'll throw this into the mix ...
The following is a 2-Part post. This first post is just the description, and some sample calls. The second post is the actual Function itself.
Since we seem to get a lot of Custom Property API quastions here, I whipped up an 'ubder-routine' that will read AND write AND create custom properties, however many you want, each being a different data type, all at the same time, and do it all with one call.
It will also 'coerce' your passed data into the correct SW data type for the property; so if you arent sure if the prop is a string or a date, just send it a string, it will do the rest. However, dont pass the function an OBJECT, or hope it will turn an integer into a Date or something.
If you pass a Param name that does not exist, one will be created. However, if you dont pass a Specific SW Property data type (string,double,boolean,date) and instead pass a variant, you are getting stuck with a STRING.
It returns a variant safearray of values of each param name you passed. These values are what the values of the Custom properties were on exit from the routine. They *should* reflect what you sent it.
If you pass pure crap for parameters, it's just gonna exit the routine and return EMPTY, so you might wanna check the return for EMPTY before you start checking to see what the return values are.
The function expects to be passed 3 paramaters: The COMPONENT2 object, a safearray of one or more Config-specific parameters, and a safearray of one or more Config-specific values.
Since this function reads right from an assembly component, you want to have an assembly open, and one of the components selected.
'---- set up code starts here --------------
Sub Main
Dim swApp As SldWorks.SldWorks
Dim Part As ModelDoc2
Dim selmgr As SelectionMgr
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim comp As Component2
Set selmgr = Part.SelectionManager
Set comp = selmgr.GetSelectedObject3(1)
' now for the calls to the function
'
' set up 4 different data types for one call
Dim Prop1 As String: Prop1 = "test String"
Dim Prop2 As Date: Prop2 = Now
Dim Prop3 As Double: Prop3 = 3.14159265
Dim Prop4 As Variant: Prop4 = Empty
' Create an array of Config-specific proprty names (case unimportant)
' the last property we will use a default-supplied SW Custom property
PropNames = Array("Name1", "Name2", "Name3", "Description"

PropVals = Array(Prop1, Prop2, Prop3, Prop4)
retval = ComponentProps(comp, PropNames, PropVals)
' now check the return values
If Not (IsEmpty(retval)) Then
For I% = 0 To UBound(retval)
msg$ = msg$ & retval(I%) & vbCrLf
Next I%
MsgBox msg$, 32, "Return values"
End If
End Sub