Distribution List Resolution with new Contact List

G

Guest

Hello,

I want to add a distribution list to a new contact list. I can do this
using the contact list name adding this to a temporary recipients list
and then resolveall and addmembers. Unfortunately, this appears to not
work for all the contacts because some contacts are not on the
resolution location list (they are only in the new contact list).


It works if I manually set the new contact list in the address book
resolution list, but there's got to be an easier way. Why doesn't
resolve allow a list of address books?


Do I have to programmitically vba the new contact list into the
resolution list just to make dist lists from a newly defined contact
list?? What would this code look like?


Thanks!
 
G

Guest

I believe your e-mail addresses/Contacts will resolve if you configure the
Contacts folder containing that data via the Outlook Address Book tab in the
folder's Properties page. If you check off "Show this folder as an e-mail
Address Book" the Contacts in the folder can now be resolved against an
e-mail address or name.
 
D

davyb

Eric,

Thanks for the reply! I can get it to work exactly the way I want by
doing a lot of manual gui manipulation of the Outlook address book
resolution list. That is, if the new contact list is an "Address Book"
and has been put as the first item in the Profile's address resolution
list.

My question is how do I do that in the Access application that is
building the contacts list and the distribution list? By the way this
is in the MAPI (Exchange) world.

The contacts list goes in next to the inbox and is shown as a "contact
list" because it is added to the folder collection as a olContactList
item, but the box to "show" as a contact list is not checked (this
information is from a post mortem examination of Outlook after
exporting the contact list from my Access VBA application to Outlook).
What is VBA for checking "Show this folder..."? Maybe I have to
"update" the address lists collection?? The new contact list is on
end of the list of address lists. When I try to reorder the addresslist
list I get a readonly error; apparently the Exchange "global" address
list, which is first in the default list, is protected -- so how is it
reordered through the GUI?? (What, the Profile resolution protocol and
AddressList collection are completely different entities or something??
-- one was done and Mars and the other was done on Venus)

I want to have my new contact list promoted to an Address Book and
placed first in the resolution list -- clear and simple? Then,
building a distribution list should work with this bizarre method of
resolution of recipients -- why isn't there a simple link from the
distribution list and the address book?? Looks like a remnant of MAPI
complexity that makes a simple operation like copying the email address
([email protected]) from the email address book an exercise in "It _won't_
let me do that!!"

I may have to add all the addresses to the "Contacts" address book for
resolution purposes (easy enough in the VBA) and then do the resolve.
Actually I did try this and I still only get about half the items on
the recipients list to resolve and add to the distribution list. I'm
currently looking into what is happening in this case, but as I started
out saying this should be easy. However, given the complete absence of
usability for building and using distribution lists through the Outlook
client GUI (a common need in the corporate world), I guess I shouldn't
be surprised.

Thanks for any help!

Dave Boyd
 
G

Guest

The MAPIFolder.ShowAsOutlookAB property allows you to programmatically
specify whether any given Contacts folder is displayed as an Outlook Address
Book.

Also, Contact folders local to your Mailbox or .pst cannot be resolved by
other users (not sure if this is what you're implying), although I believe a
shared Contacts folder can be used as an Outlook Address Book.

Furthermore, only Exchange administrators can control what goes into the
Global Address List, whether they are entries or additional address lists.
You can also control which address list is displayed first and in which order
address lists are used for resolution in the Addressing dialog from the Tools
-> Options menu in the Address Book.
 
D

davyb

Hi,

I'll try the propertly, thanks.

Not sure why the answer to my question on how to control the order of
address books has come back twice now that it can be done in a GUI
dialog. 1) I said that I can do that from the beginning. 2) The
reason for asking the question in the VBA programming section of
Outlook is to find out how to do that programmatically in VBA.

The reason I mention the Contacts folder is that this is already on the
address resolution list. However if the Global List is first then
there is still some problem in resolving myDistribution List.

I really want to set the resolution order so that myDistribution list
is resolved to addresses in myContact folder.

If this is still unclear and doesn't have a programmatic answer, I'll
put some sample code here.

Thanks for your patience.

Dave
 
G

Guest

What I don't understand is WHY you have to change the order of address
books/name resolution programmatically, if you can do it in the UI and if
this is just for yourself.
 
D

davyb

Eric,

I see your problem, it's not for myself. The Access application has
been distributed to the corporate team working on a particular project,
call it Project X. The team members need to communicate with others on
the Project X Contacts List. The distribution list feature of the
Access application is a key feature. Each member should be able to
send email information to a set or subset of the Project. This is
called "collaboration".

As a team leader on Project X, I find the contacts features in Outlook
to be difficult to use -- the multitude of fields in the contacts list
is _never_ used beyond a few key ones like name and telephone numbers
and ... _the_ key field --email address-- is, in many Outlook usage
scenarios, half buried in unusable (ie cut and paste doesn't work!)
MAPI clutter.

So to reiterate: The Access application is distributed to each member
(about a hundred) in a useful table with fields for name, telephone#,
email address, organization, building, role etc. The Access
application has a switchboard with "View" and "Export to Outlook".

Never had to explain my application to get a technical explanation, is
this stuff secret? You can send the answer to me privately if it
shouldn't be shown to the great unwashed masses. Is it changing
dramatically and rapidly? In the conservative corporate IT world, we
just migrated from Office 97 to Office 2003 last week , so no worries
there.

Or is the real answer that Outlook is such a patched mess that it can't
be done programmatically?

Dave

PS By the way the "Global Address Book", is not global across these
project team members in case you want/need a justification for every
feature of the application before answering. The GUI method works, but
trying to rearrange the order programmatically seems to give an access
violation and I'm not sure which list/cache is used to do the
"resolution". A reasonable answer might involve updating a "cache"
somewhere as well as explaining how the order of the resolution list is
manipulated.
 
G

Guest

You mentioned that you have tried to rearrange the order of the address lists
programmatically - I'd be very interested in hearing how you are doing this;
could you post some sample code please?

You are also being very quick to shoot down Outlook in terms of being unable
to meet your needs, but I am still at a loss to understand what your key
difficulty is. If you want to ensure that addresses are resolved, ensure
that it's containing list is published as an Outlook Address Book. If you
want to ensure that certain addresses are resolved first, use the GUI to
control this on a per-profile basis. However, as long as you don't have
duplicate information the order of resolution shouldn't really matter as long
as addresses are resolved, which they will if they exist.

Furthermore, Contacts in Outlook are only as unwieldy as you make them out
to be. Views can be customized to only display frequently used fields, and
the Contact forms themselves can be designed to show only frequently used
fields.

How exactly does Access fit into this? Are you linking Outlook Address
Books as a table in the database? Are you using Access VBA to control
Outlook for sending e-mails? Please give me some more specifics as to the
functionality of your current solution and I'll endeavour to address any pain
points.
 
D

davyb

Eric,

Here's a quick response (more to follow -- including source code):
Access VBA fits in since I haven't been able to export a contact list
from the Outlook GUI and share it with others. Perhaps Outlook doesn't
fit my needs because I'm ignorant -- that's a given -- so let's just
say, show me how to export a contact list, make a few addtions and
corrections to it and then email it to someone else so they can import
it and use it.

One problem with using the existing order for resolution is duplicates
in the Contacts folder. I want to provide the latest information
relevant to the Project is a new, separate Contacts folder. (Don't get
me started on duplicates -- adding them more than once seems to result
in random behavior by the target Contact list.)

Thanks,

Dave
 
G

Guest

You can easily export a Contacts folder to a .pst file that you can e-mail to
another user. Choose "Import and Export..." from the File menu in Outlook.

However, if you are both in the same Exchange organization, you can share
access to your default Mailbox folders (Contacts, Tasks, etc.) through the
Delegates tab in Outlook's Options dialog. Then other users can open your
folder from "File -> Open -> Other User's Folder...". They can't use a
shared Contacts folder as an Outlook Address Book for address resolution
though. A better alternative is to put shared Contacts in a Public Folder,
which CAN be used as an Outlook Address Book.
 
D

davyb

Eric,

That is easy and only took me a day to implement and make a little more
user friendly in VBA (Access). Now the same question for distribution
lists, which are more useful in some ways than the overly verbose
contract list items. They should consist of a name and an email list
and you should be able to export them, import them and modify them in
between as needed. How does one do that?

The setting of the contact list property to ShowAsOutlookAB has helped
the resolve process work without having each user dive into changing
the address book order, however, it has at least one bug with similar
names. See separately forwarded code and the failure to resolve
Lastname1 and LastName2 -- notice it succeeds for LastName3.

Dave
 
G

Guest

You sent me your code separately, but with no direction as to what I should
be looking for nor details on what you are trying to do.

I briefly looked at it and noticed you have a table with e-mail addresses.
What is the purpose of duplicating information that's stored in an Outlook
Contact list?

Also, what exactly are you trying to achieve with Contact Distribution
Lists? I'm having a really hard time understanding the business problem that
you are trying to solve and the purpose of your solution.
 
D

davyb

Eric,

Glad to hear you got the sample code. I would have attached it to the
posted explanation but I'm not sure how to do that. If you run the
code it will create an Outlook contact list and some distribution
lists. The problem is that all the names do not resolve (if it is
reproduced on your machine). In particular LastName1 and LastName2 do
not resolve. Can you confirm or deny that? I originally thought that
the problem was with address book order, but at least part of it is
that resolution of similar names such as LastName1 and LastName10 does
not work. (Run the test module program to gen the data.)

The business problem is to share distribution lists with the members of
a group that want to communicate with each other. The distribution
lists allow each member of the group to quickly and easily send
information to other members of the group or subgroup. Creating a
contact list with embedded distribution lists is a good candidate for
automating since it involves many repetitive operations in Outlook.
Outlook's distribution list handling is poor to non-existent for this
purpose, or is there a positive answer to my question on this? Sending
the members of the group an application that allows them to have the
distribution list with a single click and to use the associated set of
distribution lists seems like a good idea, or am I barking up the wrong
tree? Maybe Outlook programming really is a "...mixed experience..."
and I should wait for Outlook 2007?

Thanks,

Dave
 
G

Guest

Key question: are you using Exchange? If so, simply create a Contacts folder
in your Public Folders hierarchy, and configure it on each Outlook client to
be used as an Outlook Address Book. Create as many Distribution Lists as you
want in that folder, containing unique sets of Contacts from that same
folder. Very, very easy to share. You don't need to duplicate these
addresses in a database at all.

I don't see anything advanced or unsupported regarding your use of
Distribution Lists if you use existing Outlook functionality. Start a new
e-mail, begin typing the name of your DL in the To: line and resolve the
address; you'll get a choice of possibilities if it doesn't resolve right
away.
 
G

Guest

Eric

When resolving an address I notice that it resolves differently then if I
select a member from the list on known contact. When I resolve using a name
and adderss it does not point back to the item in the address book. When I
select a member from the contacts it will. How do I make this happen via
vba ?

Hal
 
G

Guest

Hey, what happened to Dave? :)

Resolves differently how? FYI, you *can't* obtain a ContactItem object from
an AddressEntry object. The latter you get from a Recipient object, and
every new e-mail contains all To, Cc and Bcc names/addresses in the
MailItem.Recipients collection. The Recipient.Resolve method is actually
fairly useless - if you enter a valid e-mail address and there is no matching
address in any of your Outlook Address Books, it will still resolve. If the
name resolves against the OABs, it will resolve.

What is so important about resolving recipients? Why do you need to
reference items in a Contacts folder?

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
G

Guest

open a dl and select a member and add them to your dl.

if you click on the member you are on their information from the address book.

if you add use the objdstlist.addmember with a recipent object with a valid
addres from the OAB then it doesnt point back. I want it to point back.
 
G

Guest

Are you saying that if you add a member to a Distribution list using the
..AddMember method, and you double-click that member, it doesn't open their
Contact? If so, I can't replicate this behaviour. When I call .AddMember
using any name that exists in my default Contacts folder or secondary
Contacts folder that's enabled as an OAB, double-clicking that new member in
the form opens their Contact.

If this isn't happening for you, please show your code and give me your
Outlook version number.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 
D

davyb

Eric,

Yes it is Exchange, but this is not an option since there are several
different companies and government entities in the various project
groups I work with, so there's no globally shared area. Fortunately,
(or maybe not), many of them have their own set of Exchange servers and
office bundles (including Access).

If resolve is useless (your statement: "The Recipient.Resolve method
is actually fairly useless...), I begin to see why programming Outlook
is an exercise in futility. I keep getting this irrelvant advice to do
something in the GUI (If I have to send 100 people instructions about
how to manually set up a distribution list in the GUI, Outlook needs to
be fixed.).

The mystery to me is how recipients became the programmatic interface
to distribution lists whch consists of a list of names and an email
addresses. Why can't I programmatically build a distribution list with
names and email addresses? Maybe if I define the "recipient" with an
email address it won't matter that resolve is so useless (hadn't
thought of this before but maybe I'll find a solution despite the high
odds against)?

I'd be happy to share my distribution lists totally within Outlook, but
in my case (multiple separate Exchange servers) it will need to involve
a portable list that can be shared by sending a copy of it via email.
Can a distribution list be exported?

Any progress on the resolve bug where Lastname10 is resolved and
Lastname1 is not which results in an incomplete distribution list?

Thanks!

Dave
 
G

Guest

You may be hung up on the fact that the AddressEntry.Name property is
read-only for Recipient objects you add to a Distribution List if there is NO
corresponding Contact item for that name/address combination.

What you can do is this:

Dim objNS As Outlook.NameSpace
Dim objR As Outlook.Recipient
'assuming you have an objMyDistList variable that's already been set to
an existing Distribution List

Set objNS = Application.GetNamespace("MAPI")
Set objR = objNS.CreateRecipient("Jane Doe <[email protected]>")
objR.Resolve
objMyDistList.AddMember objR
objMyDistList.Save

The Distribution List will now list both the display name and the e-mail
address for the user you just added.

You can also easily forward a Distribution List to other people via e-mail.
However, if you've added a member to that Distribution List by selecting from
your Contacts folder, they will have to have the same Contact in order for
e-mails using that Distribution List to work correctly. You can always click
the "Update Now" button to ensure that the link to the correct Contact is
refreshed, however you may need to expand the DL name in the To: box of an
e-mail in order for this to work correctly. In my tests, if I didn't expand
the DL, the e-mail actually never got sent to members that pointed to a
Contact item in a folder stored only in the Contacts folder of the user who
forwarded the Distribution List.
 

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