C
Chris O''''Neill
Awhile back, I had a problem grabbing the Outlook Contact.EntryID and saving
it in my table. I could grab the Contact.Parent.StoreID, but Outlook was
returning a ZLS for Contact.EntryID even though the Contact Item was created.
I need the Contact.EntryID so I can later pull up the Contact Item using
NameSpace.GetItemFromID(Contact.EntryID, Contact.Parent.StoreID).
After flailing around, I managed to resolve it, although I'm not sure what I
did to solve it (I was flailing at the time <g>). All was working fine up
until last night.
Last night, I converted my application from early binding (explicit
references) to late binding. Although I don't notice any performance
difference with late binding, my application is back to grabbing the
Contact.Parent.StoreID but returning a ZLS for the Contact.EntryID. (Sighing
and banging my head on my desk.....)
Without posting all the code, here's what I'm doing:
Dim objOutlook as Object
Dim nmsOutlookNameSpace as Object
Dim objContact as Object
Set objOutlook = CreateObject("Outlook.application")
Set nmsOutlookNameSpace = objOutlook.GetNamespace("MAPI")
Set objContact = objOutlook.CreateItem(olContactItem)
With objContact
[code to populate objContact here]
.Save
Me.txtOutlookContactID = objContact.EntryID
Me.txtOutlookContactParentID = objContact.Parent.StoreID
End With
As I said, the Contact Item *is* created (I can open Outlook and look at
it), so there *must* be a Contact.EntryID
Any ideas on what might be causing this to happen again? Also, isn't there
a way to just recursively search Outlook's Contact Items (using first and
last name, for instance) and pull out the EntryID ad Parent.StoreID that way?
(It seems to me that would be *much* easier than this!)
Thanks, yet again, for all the help and advice!
Regards, Chris
it in my table. I could grab the Contact.Parent.StoreID, but Outlook was
returning a ZLS for Contact.EntryID even though the Contact Item was created.
I need the Contact.EntryID so I can later pull up the Contact Item using
NameSpace.GetItemFromID(Contact.EntryID, Contact.Parent.StoreID).
After flailing around, I managed to resolve it, although I'm not sure what I
did to solve it (I was flailing at the time <g>). All was working fine up
until last night.
Last night, I converted my application from early binding (explicit
references) to late binding. Although I don't notice any performance
difference with late binding, my application is back to grabbing the
Contact.Parent.StoreID but returning a ZLS for the Contact.EntryID. (Sighing
and banging my head on my desk.....)
Without posting all the code, here's what I'm doing:
Dim objOutlook as Object
Dim nmsOutlookNameSpace as Object
Dim objContact as Object
Set objOutlook = CreateObject("Outlook.application")
Set nmsOutlookNameSpace = objOutlook.GetNamespace("MAPI")
Set objContact = objOutlook.CreateItem(olContactItem)
With objContact
[code to populate objContact here]
.Save
Me.txtOutlookContactID = objContact.EntryID
Me.txtOutlookContactParentID = objContact.Parent.StoreID
End With
As I said, the Contact Item *is* created (I can open Outlook and look at
it), so there *must* be a Contact.EntryID
Any ideas on what might be causing this to happen again? Also, isn't there
a way to just recursively search Outlook's Contact Items (using first and
last name, for instance) and pull out the EntryID ad Parent.StoreID that way?
(It seems to me that would be *much* easier than this!)
Thanks, yet again, for all the help and advice!
Regards, Chris