Enumeration over customDocumentProperties?

Hi
The enumeration object below is not set…
Anyone an idea why?
thanks!

Sub LoopOverCPDs
    Dim oProps as Object
    Dim oDocProps as Object
    Dim PropsEnum as Object
    Dim s1$

    s1="test"
    oDocProps = ThisComponent.getDocumentProperties()
    oProps = oDocProps.UserDefinedProperties
    PropsEnum = oProps.createEnumeration()

' Runtime Error 'Object Variable not set" on the next line...
    Do While PropsEnum.hasMoreElements()
        If Left (PropsEnum.nextElement, len(s1)) = s1 then
            s = s & "" & PropsEnum.nextElement()
        End If
    Loop
    msgbox s

End Sub

The return value of createEnumeration() is void. You need another loop. For each prop in oProps…

Thanks. So I forget about the createEnumeration (that does work for other objects, but I seem to miss the clue ) . So this is OK:

	For i = 0 to uBound(sDocPropValues())
		oCustomDocProp =  sDocPropValues(i)
		If Left (oCustomDocProp.Name, len(s1)) = s1 Then
		  s = s & ";  " & oCustomDocProp.Name
		End If
	Next