ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Put Email Address from Excel to Outlook (https://www.excelbanter.com/excel-programming/289539-put-email-address-excel-outlook.html)

Terry

Put Email Address from Excel to Outlook
 
Dear all,
My question is how to put the Email Address(by manual input) in Excel into the "TO" field in Microsoft Outlook ?
For instance, I have an email address in a worksheet, Company name on column A and Email Address on column B. And I also have a number of worksheets in the same file named by the Company name.
I 've tried the routingslip function that each worksheets can be e-mailed through Microsoft outlook, but I have to type in the Email address at Outlook first.

Is there any method that I can type the Email address of the company in Excel and automatically put the email address on the "TO" field in Outlook, not using the address book of Outlook?

Thanks for help in advance
Best Regards,
Terry

patrick molloy

Put Email Address from Excel to Outlook
 
code snippet...
Dim objOutlook As Outlook.Application
Dim objEMailMsg As Outlook.MailItem

Set objOutlook = New Outlook.Application
Set objEMailMsg = _
objOutlook.CreateItem(itemtype:=olMailItem)

With objEMailMsg
If PhoneList(sNames) Then
For Each item In sNames
If Not IsNull(item) Then
Set myrecipient = _
.Recipients.Add(item)
myrecipient.Type = olTo
End If
Next
End If

.Subject = "P&L Summary for " & REPORTDATE
.HTMLBody = PNL_MESSAGE
.Display

' .Send
End With


PhoneList is a function that returns a list of email
addresses from a source, whether its an excel table or
text file or whatever.

You need to set a refrence in the VBA IDE to the MS
Outlook Object Library

HTH
Patrick Molloy
Microsft Excel MVP

-----Original Message-----
Dear all,
My question is how to put the Email Address(by manual

input) in Excel into the "TO" field in Microsoft Outlook ?
For instance, I have an email address in a worksheet,

Company name on column A and Email Address on column B.
And I also have a number of worksheets in the same file
named by the Company name.
I 've tried the routingslip function that each

worksheets can be e-mailed through Microsoft outlook, but
I have to type in the Email address at Outlook first.

Is there any method that I can type the Email address of

the company in Excel and automatically put the email
address on the "TO" field in Outlook, not using the
address book of Outlook?

Thanks for help in advance
Best Regards,
Terry
.



All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com