View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default DSO and Custom Properties

I assign a custom property to a file (a.xls); the property name is "Balance"
and its value is 123.45

In another file the following code does retrieve the 123.45:

Sub surface()
Dim FileName As String
Dim DSO As DSOFile.OleDocumentProperties
Set DSO = New DSOFile.OleDocumentProperties
FileName = "C:\a.xls"
DSO.Open sfilename:=FileName
MsgBox (DSO.CustomProperties.Count)
MsgBox (DSO.CustomProperties.Item("Balance").Value)
DSO.Close
End Sub

I would like to get the value without knowing the name; both:
MsgBox (DSO.CustomProperties.Item(1).Value)
and
MsgBox (DSO.CustomProperties.Item(1).Name)

fail. How can i get the name of the first custom property??

--
Gary''s Student - gsnu200723