M
McKilty
I've written code to compare our Public Folder Recipients List with
information we have in several databases. The program will update the
Public Folders with the information in the database.
The snag I've hit is with the e-mail address. I am using Outlook
Redemption and retrieving Email1Address but the type is EX and what we
have in the database is SMTP.
My applicable code, which will fail because of this, is:
-----------------------------------------------Dim myFolder As outlook.MAPIFolder
Dim myInbox As outlook.MAPIFolder
Dim myNameSpace As outlook.NameSpace
Dim myOutlook As outlook.Application
Dim SafeContact, oContact
Set myOutlook = CreateObject("Outlook.Application." & Val(Left
(outlook.Version, 2)))
Set myNameSpace = myOutlook.GetNamespace("MAPI")
myNameSpace.Logon
Set myFolder = myNameSpace.Folders("Public Folders").Folders("All
Public Folders").Folders("Contacts").Folders(gsPublicContactsFolder)
Set SafeContact = CreateObject("Redemption.SafeContactItem")
Set oContact = myFolder.Items.Find("[EMPID2] = 472")
If UCase(SafeContact.Email1Address) <> UCase
("rbray@dlbassociates.com") Then
SafeContact.Email1Address = ("rbray@dlbassociates.com")
End If
-----------------------------------------------It's off because some addresses are EX and some are SMTP, yet all are
employees so I would have thought they'd all be the same.
I tried writing code to handle this, but then some of the EX types
have a string of numbers after the name. For example:
[snip]/cn=Recipients/cn=rbray
[snip]/cn=Recipients/cn=bmarshall21766933
Those numbers don't appear anywhere in the SMTP address and even when
you click on the properties and view the EX, you don't see those
numbers.
information we have in several databases. The program will update the
Public Folders with the information in the database.
The snag I've hit is with the e-mail address. I am using Outlook
Redemption and retrieving Email1Address but the type is EX and what we
have in the database is SMTP.
My applicable code, which will fail because of this, is:
-----------------------------------------------Dim myFolder As outlook.MAPIFolder
Dim myInbox As outlook.MAPIFolder
Dim myNameSpace As outlook.NameSpace
Dim myOutlook As outlook.Application
Dim SafeContact, oContact
Set myOutlook = CreateObject("Outlook.Application." & Val(Left
(outlook.Version, 2)))
Set myNameSpace = myOutlook.GetNamespace("MAPI")
myNameSpace.Logon
Set myFolder = myNameSpace.Folders("Public Folders").Folders("All
Public Folders").Folders("Contacts").Folders(gsPublicContactsFolder)
Set SafeContact = CreateObject("Redemption.SafeContactItem")
Set oContact = myFolder.Items.Find("[EMPID2] = 472")
If UCase(SafeContact.Email1Address) <> UCase
("rbray@dlbassociates.com") Then
SafeContact.Email1Address = ("rbray@dlbassociates.com")
End If
-----------------------------------------------It's off because some addresses are EX and some are SMTP, yet all are
employees so I would have thought they'd all be the same.
I tried writing code to handle this, but then some of the EX types
have a string of numbers after the name. For example:
[snip]/cn=Recipients/cn=rbray
[snip]/cn=Recipients/cn=bmarshall21766933
Those numbers don't appear anywhere in the SMTP address and even when
you click on the properties and view the EX, you don't see those
numbers.