Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to send an email from excel to a distrobution list in
outlook. Any nifty code out there? I found this on a group but can't get it to work. Const olFolderContacts = 10 sDistName = "Friends" 'set the distribution list name here Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") Set colContacts = objNamespace.GetDefaultFolder (olFolderContacts).Items intCount = colContacts.Count For i = 1 To intCount If TypeName(colContacts.Item(i)) = "DistListItem" Then Set objDistList = colContacts.Item(i) sEmails = ""; If objDistList.DLName = sDistName Then For j = 1 To objDistList.MemberCount sEmails = sEmails & ";" & objDistList.GetMember (j).Address Next 'send the mail using the emails u got! ;-) enjoy End If End If Next Any help will be appreciated. Thanks, paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Send a Sheet as body of Outlook Email | Excel Discussion (Misc queries) | |||
Send email with Outlook | Excel Programming | |||
send email macro with Outlook running | Excel Programming | |||
Send Range to Outlook and Email it | Excel Programming | |||
***** PLEASE HELP **** Send an email from Excel to outlook with an automatic macro | Excel Discussion (Misc queries) |