Addresslist issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm writing some VBA code to run in Outlook 2002 as a macro. What I want to do is go through the users addresslist (GAL, contacts etc..) and find a matching list name, for further processing

I am looping through an AddressLists object, and comparing AddressList.Name to my search name.
The problem is that the program cannot find a match.
I know that the search name I am using is a valid address list name, that does come up when selecting a destination e-mail address in Outlook.

What I did find out is that if I use a similar but different search name, I get the address list I want. For example, if the address list name when typing in an Outlook e-mail message is "city-group", I find that using the search name "city-group" doesn't give me a match, but a search name of just "group" does give me the same list as "city-grouip"

Could it be that there is something like an alias sitting on top of the actual address lists name? If so, is there a way around this programmatically, assuming you cannot change any configuration settings

Thanks in advance

Selgin
 
Do you get the name automatically resolved when you type it in a message in
Outlook? Is it possible that you have multiple matches for that search
string?

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


Selgin said:
Hi,

I'm writing some VBA code to run in Outlook 2002 as a macro. What I want
to do is go through the users addresslist (GAL, contacts etc..) and find a
matching list name, for further processing.
I am looping through an AddressLists object, and comparing
AddressList.Name to my search name.
The problem is that the program cannot find a match.
I know that the search name I am using is a valid address list name, that
does come up when selecting a destination e-mail address in Outlook.
What I did find out is that if I use a similar but different search name,
I get the address list I want. For example, if the address list name when
typing in an Outlook e-mail message is "city-group", I find that using the
search name "city-group" doesn't give me a match, but a search name of just
"group" does give me the same list as "city-grouip".
Could it be that there is something like an alias sitting on top of the
actual address lists name? If so, is there a way around this
programmatically, assuming you cannot change any configuration settings?
 
Hi Dmitry,

No multiple matches. I have actually just found out that the name I type in Outlook is the "Display Name" for that address list, and the name I reference in my code is the "Alias Name", as per the exchange server configuration.

Any ideas how I can reference the list based on that Display Name? Or if I can programmatically resolve between the display name and alias name?

Thanks

Selgin
----- Dmitry Streblechenko wrote: -----

Do you get the name automatically resolved when you type it in a message in
Outlook? Is it possible that you have multiple matches for that search
string?

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


Selgin said:
to do is go through the users addresslist (GAL, contacts etc..) and find a
matching list name, for further processing.AddressList.Name to my search name.
The problem is that the program cannot find a match.
I know that the search name I am using is a valid address list name, that
does come up when selecting a destination e-mail address in Outlook.I get the address list I want. For example, if the address list name when
typing in an Outlook e-mail message is "city-group", I find that using the
search name "city-group" doesn't give me a match, but a search name of just
"group" does give me the same list as "city-grouip".actual address lists name? If so, is there a way around this
programmatically, assuming you cannot change any configuration settings?
 
You can use Namespace.CreateRecipient(), then call Recipient.Resolve - this
way you won't have to iterate through GAL at all.

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


Selgin said:
Hi Dmitry,

No multiple matches. I have actually just found out that the name I type
in Outlook is the "Display Name" for that address list, and the name I
reference in my code is the "Alias Name", as per the exchange server
configuration.
Any ideas how I can reference the list based on that Display Name? Or if
I can programmatically resolve between the display name and alias name?
 
Back
Top