Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to generate email list for Outlook from Excel cells
I have a contact list created in Excel, on each row I have different contact
information such as name, business unit, phone and email address. What I want to do: When filtering on a certain business unit from this table I would like to generate in Outlook the email list of this business unit to send an email to all the persons of these business unit. Please let me know how I can make that happen. Thanks, Emmanuel |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to generate email list for Outlook from Excel cells
Hi Emanu88
Try this sample for Outlook This will use all the visible cells in A1:A10 in "Sheet1" Change it to your sheet and range Sub Mail_small_Text_Outlook() 'Working in Office 2000-2007 Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim cell As Range Dim strto As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next For Each cell In ThisWorkbook.Sheets("Sheet1").Range("A1:A10").Spec ialCells(xlCellTypeVisible) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell On Error GoTo 0 If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" On Error Resume Next With OutMail .To = strto .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = strbody 'You can add a file like this '.Attachments.Add ("C:\test.txt") .Display 'or use .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Emanu88" wrote in message ... I have a contact list created in Excel, on each row I have different contact information such as name, business unit, phone and email address. What I want to do: When filtering on a certain business unit from this table I would like to generate in Outlook the email list of this business unit to send an email to all the persons of these business unit. Please let me know how I can make that happen. Thanks, Emmanuel |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to generate email list for Outlook from Excel cells
On Oct 21, 7:27*am, "Ron de Bruin" wrote:
Hi Emanu88 Try this sample forOutlook This will use all the visible cells in A1:A10 in "Sheet1" Change it to your sheet and range Sub Mail_small_Text_Outlook() 'Working in Office 2000-2007 * * Dim OutApp As Object * * Dim OutMail As Object * * Dim strbody As String * * Dim cell As Range * * Dim strto As String * * Set OutApp = CreateObject("Outlook.Application") * * OutApp.Session.Logon * * Set OutMail = OutApp.CreateItem(0) * * On Error Resume Next * * For Each cell In ThisWorkbook.Sheets("Sheet1").Range("A1:A10").Spec ialCells(xlCellTypeVisibl*e) * * * * If cell.Value Like "?*@?*.?*" Then * * * * * * strto = strto & cell.Value & ";" * * * * End If * * Next cell * * On Error GoTo 0 * * If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) * * strbody = "Hi there" & vbNewLine & vbNewLine & _ * * * * * * * "This is line 1" & vbNewLine & _ * * * * * * * "This is line 2" & vbNewLine & _ * * * * * * * "This is line 3" & vbNewLine & _ * * * * * * * "This is line 4" * * On Error Resume Next * * With OutMail * * * * .To = strto * * * * .CC = "" * * * * .BCC = "" * * * * .Subject = "This is the Subject line" * * * * .Body = strbody * * * * 'You can add a file like this * * * * '.Attachments.Add ("C:\test.txt") * * * * .Display * 'or use .Send * * End With * * On Error GoTo 0 * * Set OutMail = Nothing * * Set OutApp = Nothing End Sub -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Emanu88" wrote in message ... I have a contactlistcreated inExcel, on each row I have different contact information such as name, business unit, phone and email address. What I want to do: When filtering on a certain business unit from this table I would like to generate inOutlookthe emaillistof this business unit tosendan email to all the persons of these business unit. Please let me know how I can make that happen. Thanks, Emmanuel- Hide quoted text - - Show quoted text - Hello my name is Drew and i have a similiar question. I have a list of contacts that I would like to send a general email to. The subject will be the same as will most of the text. I would like to write a Macro that would fill the "To" field from one column, then fill the constant subject line, then fill in the contacts name and company name into the text of the email. Then I would like the macro to repeat this process down the column. Thanks in advance, Drew |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to generate email list for Outlook from Excel cells
Hi Drew
Try this one http://www.rondebruin.nl/mail/folder3/message.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Drew" wrote in message ... On Oct 21, 7:27 am, "Ron de Bruin" wrote: Hi Emanu88 Try this sample forOutlook This will use all the visible cells in A1:A10 in "Sheet1" Change it to your sheet and range Sub Mail_small_Text_Outlook() 'Working in Office 2000-2007 Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim cell As Range Dim strto As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next For Each cell In ThisWorkbook.Sheets("Sheet1").Range("A1:A10").Spec ialCells(xlCellTypeVisibl*e) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell On Error GoTo 0 If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" On Error Resume Next With OutMail .To = strto .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = strbody 'You can add a file like this '.Attachments.Add ("C:\test.txt") .Display 'or use .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Emanu88" wrote in message ... I have a contactlistcreated inExcel, on each row I have different contact information such as name, business unit, phone and email address. What I want to do: When filtering on a certain business unit from this table I would like to generate inOutlookthe emaillistof this business unit tosendan email to all the persons of these business unit. Please let me know how I can make that happen. Thanks, Emmanuel- Hide quoted text - - Show quoted text - Hello my name is Drew and i have a similiar question. I have a list of contacts that I would like to send a general email to. The subject will be the same as will most of the text. I would like to write a Macro that would fill the "To" field from one column, then fill the constant subject line, then fill in the contacts name and company name into the text of the email. Then I would like the macro to repeat this process down the column. Thanks in advance, Drew |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to generate email list for Outlook from Excel cells
On Oct 27, 12:35*pm, "Ron de Bruin" wrote:
Hi Drew Try this onehttp://www.rondebruin.nl/mail/folder3/message.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Drew" wrote in ... On Oct 21, 7:27 am, "Ron de Bruin" wrote: Hi Emanu88 Try this sample forOutlook This will use all the visible cells in A1:A10 in "Sheet1" Change it to your sheet and range Sub Mail_small_Text_Outlook() 'Working in Office 2000-2007 Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim cell As Range Dim strto As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next For Each cell In ThisWorkbook.Sheets("Sheet1").Range("A1:A10").Spec ialCells(xlCellTypeVisibl**e) If cell.Value Like "?*@?*.?*" Then strto = strto & cell.Value & ";" End If Next cell On Error GoTo 0 If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1) strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" On Error Resume Next With OutMail .To = strto .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = strbody 'You can add a file like this '.Attachments.Add ("C:\test.txt") .Display 'or use .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "Emanu88" wrote in message ... I have a contactlistcreated inExcel, on each row I have different contact information such as name, business unit, phone and email address. What I want to do: When filtering on a certain business unit from this table I would like to generate inOutlookthe emaillistof this business unit tosendan email to all the persons of these business unit. Please let me know how I can make that happen. Thanks, Emmanuel- Hide quoted text - - Show quoted text - Hello my name is Drew and i have a similiar question. I have alistof contacts that I would like tosenda general email to. The subject will be the same as will most of the text. I would like to write a Macro that would fill the "To" field from one column, then fill the constant subject line, then fill in the contacts name and company name into the text of the email. Then I would like the macro to repeat this process down the column. Thanks in advance, Drew- Hide quoted text - - Show quoted text - Thank you so much for the help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I merge a list of email addresses from exel into outlook? | New Users to Excel | |||
How do I generate an email list from my worksheet? | Excel Discussion (Misc queries) | |||
Auto-generate OUTLOOK email based upon EXCEL Workbook data | Excel Discussion (Misc queries) | |||
import email addresses into a outlook distribution list | Excel Discussion (Misc queries) | |||
transfer email address cells from excel to outlook | Excel Discussion (Misc queries) |