Amend email recipients in code

Schoscho17

New Member
Joined
Oct 2, 2017
Messages
4
I have the following Code that opens a UserForm that has 6 buttons that puts a certain project email list in the .cc line. The bug I am having is that when I actually delete and email in the email bar, the macro will remember it and put it back in the .cc line.

For example
I Have Email A B and C
I Delete All of those and change it to Email D E and F
The Code will run again and put A,B,C,D,E and F in the cc bar.

How do I get it to reread my .cc bar before it posts again?


Code:
Public List As String

Sub Multi_Email_Test()
    Dim Update As String
    Dim Email As Outlook.MailItem
    Set Email = Application.ActiveInspector.CurrentItem
        UserForm1.Show

    
    On Error Resume Next

    With Email
        .CC = Email.CC & ";" & List
        .Display
    End With
        

End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
It does that because that's what the code says to do. If you just want the names in List,

Code:
        .CC = List
 
Upvote 0
The .cc List will delete everything that's already in my .cc line

I would prefer that the code just add onto the end of the cc line
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top