Inserting Additional Email Address

WorkMC

Member
Outlook version
Outlook 2010 32 bit
Email Account
This is a two part question, firstly I've setup some buttons on a ribbon in which I can insert the e-mail addresses I want to use, some will have more than one e-mail recipient. However, what ever is already in the cc box is over written, with the e-mail address that is being pressed.

With objItem
.To = EmailTo
.CC = "JoeBloggs@anywhere.com"
End With

The code above is what I'm using, is there away to append it to the cc box rather than overwrite what is already there.

Secondly, if I click the To button on the e-mail, then a list of addresses can be found, if I search for my local address book and select a specific contact group, this is added to the e-mail. Is it possible to have a macro that will select my local address book so that I can name the groups in the macro and they automatically inserted into the To box?

Hopefully, this will be the last question for the foreseeable future.
 

WorkMC

Member
Outlook version
Outlook 2010 32 bit
Email Account
This is a two part question, firstly I've setup some buttons on a ribbon in which I can insert the e-mail addresses I want to use, some will have more than one e-mail recipient. However, what ever is already in the cc box is over written, with the e-mail address that is being pressed.

With objItem
.To = EmailTo
.CC = "JoeBloggs@anywhere.com"
End With

The code above is what I'm using, is there away to append it to the cc box rather than overwrite what is already there.

Secondly, if I click the To button on the e-mail, then a list of addresses can be found, if I search for my local address book and select a specific contact group, this is added to the e-mail. Is it possible to have a macro that will select my local address book so that I can name the groups in the macro and they automatically inserted into the To box?

Hopefully, this will be the last question for the foreseeable future.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
you need to use recipients.add (address) and recipients.type olcc to add names.

Dim objRecip As Recipient
Set objRecip= objitem.Recipients.Add("alias@address")
objRecip.Type = olCC ' olTo or olBCC
objRecip.Resolve ' (usually not required if using email address)
 

WorkMC

Member
Outlook version
Outlook 2010 32 bit
Email Account
OK, solved the first part but not the second when trying t
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Secondly, if I click the To button on the e-mail, then a list of addresses can be found, if I search for my local address book and select a specific contact group, this is added to the e-mail. Is it possible to have a macro that will select my local address book so that I can name the groups in the macro and they automatically inserted into the To box?
Oh, sorry, I missed this. (I'm terrible when it comes to multiple questions in one post - i almost always miss one).

it should work to add the name to the add line:

Set objRecip= objitem.Recipients.Add("group name")

you will likely need to resolve the name when you do this. Also, if the group name exists in both GAL and your local directly, you should rename the local copy or change the order of resolution so names are resolved to the local address book before it goes looking in the gal.
 

Similar threads

Top