Code:
Option ExplicitSub CATMain()
Dim oEditor As Editor
Dim oRoot As VPMRootOccurrence
Dim oOcc As VPMOccurrence
Dim oInst As VPMInstance
Dim oRef As VPMReference
Dim s As String
Dim oItem As Object
Set oEditor = CATIA.ActiveEditor
Set oRoot = oEditor.ActiveObject
Set oOcc = oRoot.Occurrences.Item(1)
Set oInst = oOcc.InstanceOccurrenceOf
Set oRef = oInst.ReferenceInstanceOf
s = "Reference Name = " & oRef.Name & vbCrLf & vbCrLf
On Error Resume Next
' Test UserRefProperties
For Each oItem In oRef.UserRefProperties
s = s & oItem.Name & _
" = " & _
oItem.ValueAsString & vbCrLf
Next
If Err.Number <> 0 Then
s = s & vbCrLf & _
"UserRefProperties FAILED" & vbCrLf & _
Err.Number & " - " & Err.Description & vbCrLf
Err.Clear
End If
InputBox "Copy Result", _
"UserRefProperties Test", _
s
End Sub