cdo problem retrieving business address from entry in address book 
Author Message
 cdo problem retrieving business address from entry in address book

Hi

I'm unable to get mapi property tags values from a selected name from
addressbook.

The highlighted line gives a run-time error [MAPI_E_NOT _FOUND(8004010f)

I anybody can help me out I'd be very grateful

Cheers

Dave

Public Sub Get_Business_Addresses()

  Dim oSession As MAPI.Session
  Dim oRecps As MAPI.Recipients
  Dim oRecp As MAPI.Recipient
  lValue = CdoPR_BUSINESS_ADDRESS_STREET    ' = &H001A001E

  Set oSession = New Session
  oSession.Logon , , , False
  Set oRecps = oSession.AddressBook(, , , , , "Select Name)

  For Each oRecp In oRecps

Quote:
>    Set oAddr = oRecp.AddressEntry.Fields.Item(lValue)

  Next
End Sub


Tue, 27 Apr 2004 22:30:44 GMT  
 cdo problem retrieving business address from entry in address book
Just some thoughts...

1) Is the Recp object set to a valid Recipient object?
2) Is the Recp object a cdoUser that has the business address set?
3) Sometimes you can't use a deeply notated object. (e.g.
orecps.AddressEntry.Fie...) Instead you have create an intermediate object
(eg. An AddressEntry object, before you jump straight to the fields
collection).


Quote:
> Hi

> I'm unable to get mapi property tags values from a selected name from
> addressbook.

> The highlighted line gives a run-time error [MAPI_E_NOT _FOUND(8004010f)

> I anybody can help me out I'd be very grateful

> Cheers

> Dave

> Public Sub Get_Business_Addresses()

>   Dim oSession As MAPI.Session
>   Dim oRecps As MAPI.Recipients
>   Dim oRecp As MAPI.Recipient
>   lValue = CdoPR_BUSINESS_ADDRESS_STREET    ' = &H001A001E

>   Set oSession = New Session
>   oSession.Logon , , , False
>   Set oRecps = oSession.AddressBook(, , , , , "Select Name)

>   For Each oRecp In oRecps

> >    Set oAddr = oRecp.AddressEntry.Fields.Item(lValue)

>   Next
> End Sub



Tue, 27 Apr 2004 22:56:38 GMT  
 cdo problem retrieving business address from entry in address book
Thanks for replying

Please bear with me I'm just getting started with cdo

Quote:
> 1) Is the Recp object set to a valid Recipient object?

Not sure, the cdo help says addressbook returns a Recipients collection.
Does the For Each... not return a Recipient object? Would Item(1) be a
better way of doing it?

Quote:
> 2) Is the Recp object a cdoUser that has the business address set?

Don't know. The oRecp returns "David Fox (E-mail)" which is a contact in an
outlook contacts folder. It has a business addres ing the contact.

Quote:
> 3) Sometimes you can't use a deeply notated object. (e.g.
> orecps.AddressEntry.Fie...) Instead you have create an intermediate object
> (eg. An AddressEntry object, before you jump straight to the fields
> collection).

I'll give that a go.

I hope I'm making myself clear for you

Cheers

Dave



Wed, 28 Apr 2004 00:40:22 GMT  
 cdo problem retrieving business address from entry in address book
ah... now the light comes on.  You are reading a contact record.  In that
case, you need to have http://www.cdolive.com/cdo10.htm in your IE
favorites.  Scroll down about 3/4 of the to get the information you need to
read that property.

ps - you are making sense, hence the light going on as soon as you mentioned
contact because it isn't the same as reading properties out of an Exchange
Global Address List or the Personal Address Book.


Quote:
> Thanks for replying

> Please bear with me I'm just getting started with cdo

> > 1) Is the Recp object set to a valid Recipient object?

> Not sure, the cdo help says addressbook returns a Recipients collection.
> Does the For Each... not return a Recipient object? Would Item(1) be a
> better way of doing it?

> > 2) Is the Recp object a cdoUser that has the business address set?

> Don't know. The oRecp returns "David Fox (E-mail)" which is a contact in
an
> outlook contacts folder. It has a business addres ing the contact.

> > 3) Sometimes you can't use a deeply notated object. (e.g.
> > orecps.AddressEntry.Fie...) Instead you have create an intermediate
object
> > (eg. An AddressEntry object, before you jump straight to the fields
> > collection).

> I'll give that a go.

> I hope I'm making myself clear for you

> Cheers

> Dave



Wed, 28 Apr 2004 11:47:17 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CDO.dll --> Retrieve Address Book

2. Retrieve SMTP email addresses of GAB address entries

3. Problems in manupulatiing Address book using CDO

4. Code to change Address Book Default Address book view

5. CDO Address entry fields - hex codes

6. Global Address Book enrtry and CDO object properties

7. howto write address book for outlook 2000 in vb/cdo

8. Using the CDO Address Book method

9. Resolve OL address book entries

10. OL97 Address Book entry creation error

11. Microsoft Exchange Mapi Visual Basic adding entries to address book

12. Displaying The Address Book for Selecting Address

 

 
Powered by phpBB® Forum Software