VBA outlook - retrieve email address from excel as recipient -
I want to retrieve the email address from Excel cells and copy them as recipients on Outlook.
Input and output:
However, "A" and "CC" are empty on Outlook.
Input and output:
Cell A1 email address I want to "Send"
Cell A2 is the email address I want to "CC to" .
My VBA code:
sub button 1_Click () Dim OutApp object Dim as an object set in the form of Mail OutApp = CreateObject ( "Outlook.Application") Set OutMail = OutApp.CreateItem (olMailItem) Resume on Error Resume with Mailmail. = Cells ("A1") .cc = Room ("A2") .bcc = "". The theme ends with "This is the subject line" error GoTo 0 set Outmail = None Set OutApp = Any End Sub
You must add recipients, not copies, or BCC properties. These properties contain only display names, to modify this property, the recipient store must be used for example: < / P>
Sub CreateStatusReportToBoss () Dim myItem Outlook.MailItem Dim myRecipient Outlook.Recipient set myItem = Applicati ("Dan Wilson") MyItem.Subject = "Status Report" myItem.Display End as (as my.re. You can find the following articles useful:
Comments
Post a Comment