excel - vba outlook Recipients -


Both email addresses of A1 and A2 cells appear in "to" on Outlook.

Input and Output:

How do I set up "cc"?

Input and output:

Cell A1 is the email address that I want to "send".

Cell A2 is the email address that I want to "cc".

VBA code: long = 0 constant until OlTo = 1 const as olcc long = long = 3 as in the form of slow outApp

< Pre> sub-button1_Click () console olMailItem 2 const olBCC object dim OutMail object as object set as myRecipient dim OutApp = CreateObject ("Outlook.Application") OutMail = OutApp.CreateItem set (olMailItem) error again Start OutMail with Next. External = OutMail.Recipients.Add (range ("A1") myRecipient.Type = olTo .cc = OutMail.Recipients.Add (range ("A2") myRecipient.Type = olCC .BCC = "" .Subject = "Got error on this subject line" Set OutMail = nothing ends with OutApp = some ending sub

You are not set Recije pient type:

  set OutMail myRecipient = .recipients.Add (range ("A1") myRecipient.Type = olTo set myRecipient = .recipients.Add With (range ("A2") myRecipient.Type = olCC .bcc = ".subject =" end of the subject line " 

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -