>im trying to access the address book of lotus from VFP using this code
>and when executes this line ...>StrName = DomItem.Value(0)
>im getting an ole error code 'unknown name' does anybody help me to understand whats wrong with this code?
>
>Domsession = createobject("Notes.Notessession")
>DomDir = Domsession.GetDatabase("","names.nsf")
>DomContacts = DomDir.GetView("People")
>DomDoc = DomContacts.GetFirstDocument()
>DomItem = DomDoc.GetFirstItem("LastName")
>if vartype(DomItem) = "O" then
> StrName = DomItem.Value(0)
>endif
>
>thanks in advance
It looks like vartype() can not be used because Notes will return an object reference even if the item doesn't exist. It's not a NULL reference, it's just empty. Use type("DomItem.Name") = "C" to check if GetFirstItem returned a valid object.
Also, I had a typo in what I previously posted on this subject. It's
DomItem.Values(0) not DomItem.Value(0).
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao