Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems accessing names.nsf from VFP
Message
General information
Forum:
Lotus Notes
Category:
Lotus Script
Miscellaneous
Thread ID:
00431425
Message ID:
00431467
Views:
9
>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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform