Open specific Outlook contact record using VBA (in Access)

C

Chris O''''Neill

I've figured out how to create Outlook contact records from a command button
in Access, but now I'd like to figure out how use an Access command button to
open Outlook to a specific contact record. Here's the logic I want to use
for my command button:

IF OutlookContactRecord exists THEN
Open OutlookContactRecord
ELSE
Create new OutlookContactRecord
END IF

I know whether (or not) a contact record exists because I set a flag in
Access when I create the record. Now, all I need to figure out is how to
call up the existing record.

Any help provided wll be greatly appreciated!

Regards, Chris
 
D

Dmitry Streblechenko

Store the contact's entry id (ContactItem.EntryID, call Save ) and reopen it
using Namespace,GetItemfromID.
You might also want to store the parent store id
(ContactItem.Parent.StoreID, used as the second optional parameter in
GetItemfromID) if the contact comes from a non-default store.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
C

Chris O''''Neill

Thank you VERY much, Dmitry, for informing me it can be done. I was thinking
I might be asking too much! :D

In the code where I create the contact item, I added this code just before
the ".save" statement:

vEntryID = .EntryID
vParentStoreID = .Parent.StoreID

When the code runs, I get nothing ("") in vEntryID and a *really* long
number in vParentStoreID. So, I *think* I've got the parent store ID but it
looks like I'm not getting the contact item's entry ID. Also, once I've got
these ID's (and stored them in the contact's record in my Access database,
how do I use Namespace,GetItemfromID to call up the contact record?

Some example code would be helpful, if you have any?

Thanks, again, for all your help...

Regards, Chris
 
C

Chris O''''Neill

By the way, I should add (in case it makes a difference?) that I'm doing all
this with Access/Outlook 2002.

Regards, Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top