A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Distribution lists in shared mailboxes



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 21st 07, 10:50 AM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Distribution lists in shared mailboxes

I was wondering if anyone could help with this problem. Basically I
wish to be able to automatically send a file (created in VB) to a mail
recipient (pretty easy using an oulook object)

But the problem is a bit more complicated. The mail should be sent to
a distribution list. And this distrubtion list in in a shared mailbox.

There is a shared mailbox - Dublin Mailbox. When I look in 'My
Conracts' I see a list of contacts ie

Anna in Mailbox - Dublin Mailbox
Niall in Mailbox - Dublin MAilbox
John in Mailbox - Dublin mailbox

When I click on any of these contacts I see a set of distribution
lists. Perhaps 20 in each contacts.

Now currently the only way to send a mail to one of these lists is to
go to the my contacts, click on the contact, then right click on the
distributionlist and select send new mail to contact

If i open a new message I cannot get any of the distrubtion lists to
appear as they are all in a shared mailbox and as from other posts
these dont appear in your address book and it is quite comlicated to
get them to appear

What I was wondering if I know the name of the mailbox is it possible
via vba to open or get a handel to the mailbox, then get a handle to
the contacts in this mailbox and from that the distribution lists that
are int he contacts. (potentially get a list of these that the user
could slect from a drop down combo box). This could then be used to
create the mail to the distribution list and attach the appropriate
file.

Is this possible

Niall

Ads
  #2  
Old May 21st 07, 01:05 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Distribution lists in shared mailboxes

I actually found code that did what I wanted

Public Sub GetOutlookFolderID()
'Dim x As Variant
Dim y As Variant
Dim z As Variant
Dim x As Outlook.DistListItem
Dim olfolder As Outlook.MAPIFolder
Dim olapp As Outlook.Application
Set olapp = CreateObject("Outlook.Application")
Set olfolder = olapp.GetNamespace("MAPI").Folders.Item("Mailbox -
Dublin Mailbox").Folders.Item("Contacts").Folders.Item("A nna")
For Each x In olfolder.Items
Debug.Print x

For y = 1 To x.MemberCount
z = x.GetMember(y).Address
Debug.Print z

Next
Debug.Print ""
Next
' olfolder.Display
' Debug.Print olfolder.EntryID
Set olfolder = Nothing
Set olapp = Nothing
End Sub

this prints out all the distribution lists in the Anna folder, and the
email addresses in them. Excuse the use variants as it was just proof
of concept bit of code and changed a few times

Maybe this will help someone else


On May 21, 9:50 am, wrote:
I was wondering if anyone could help with this problem. Basically I
wish to be able to automatically send a file (created in VB) to a mail
recipient (pretty easy using an oulook object)

But the problem is a bit more complicated. The mail should be sent to
a distribution list. And this distrubtion list in in a shared mailbox.

There is a shared mailbox - Dublin Mailbox. When I look in 'My
Conracts' I see a list of contacts ie

Anna in Mailbox - Dublin Mailbox
Niall in Mailbox - Dublin MAilbox
John in Mailbox - Dublin mailbox

When I click on any of these contacts I see a set of distribution
lists. Perhaps 20 in each contacts.

Now currently the only way to send a mail to one of these lists is to
go to the my contacts, click on the contact, then right click on the
distributionlist and select send new mail to contact

If i open a new message I cannot get any of the distrubtion lists to
appear as they are all in a shared mailbox and as from other posts
these dont appear in your address book and it is quite comlicated to
get them to appear

What I was wondering if I know the name of the mailbox is it possible
via vba to open or get a handel to the mailbox, then get a handle to
the contacts in this mailbox and from that the distribution lists that
are int he contacts. (potentially get a list of these that the user
could slect from a drop down combo box). This could then be used to
create the mail to the distribution list and attach the appropriate
file.

Is this possible

Niall



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Distribution list to an e-mail with multiple mailboxes Jamie Outlook and VBA 1 May 20th 07 11:13 PM
Distribution Lists kleivakat Outlook - Using Contacts 2 November 29th 06 10:04 PM
Adding mutliple distribution lists into a distribution list? Abel Outlook - Using Contacts 2 August 30th 06 06:51 PM
Distribution Lists sourced from linked SharePoint Contact Lists Marcela Outlook - Using Contacts 4 July 17th 06 01:08 AM
Nested Distribution Lists in shared contacts don't work Doda McCheesle Outlook - Using Contacts 0 February 24th 06 01:02 PM


All times are GMT +1. The time now is 03:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.