MS OUTLOOK 2013 - Adding Sender on the CC line

Status
Not open for further replies.

Peter Berlin

Member
Outlook version
Outlook 2013 64 bit
Email Account
POP3
Hello. I am now on my final issue. Thank you!!!!!!

I have the following vb code (attached) and I am trying to add the sender automatically to the .cc line.
the Sender will change so i can't hardcode an email address automatically to the .cc line.

I currently have a specified group on the .cc line. So I would like to leave as is but add the sender as well to the .cc line.

Please help!!

Thanks, Peter

(vb in attached file)
 

Attachments

  • vb code.pdf
    94.8 KB · Views: 592
Hi Diane.....

So Before:

Dim OutApp As Object
Dim OutMail As Object


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)


On Error Resume Next
With OutMail
.SentOnBehalfOfName = "abc@email.com"
.Display
.To = dis_contacts
.CC = rok_contacts
.BCC = ""

AFTER:

Dim OutApp As Object
Dim OutMail As Object
Dim myCC As Outlook.Recipient

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Set myCC = Rok_contacts.Recipients.Add("theaddress")
myCC.Type = olCC


On Error Resume Next
With OutMail
.SentOnBehalfOfName = "abc@email.com"
.Display
.To = dis_contacts
.CC = rok_contacts
.BCC = ""
 
It is be like this - assuming rok_contacts is the name of a contact group that will resolve.

Set myCC = OutMail.Recipients.Add("rok_contacts")
 
That is correct regarding the rok_contacts.....

ok so I now have....

Dim OutApp As Object
Dim OutMail As Object
Dim myCC As Outlook.Recipient

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Set myCC = OutMail.Recipients.Add("rok_contacts")

myCC.Type = olCC

On Error Resume Next
With OutMail
.SentOnBehalfOfName = "abc@email.com"
.Display
.To = dis_contacts
.CC = rok_contacts
.BCC = ""

It returns a compile error message - user defined type not defined on the following line.
Dim myCC As Outlook.Recipient

Thanks again Diane..
 
I got this working...but need to combine the two .cc lines. (semail and rok_contacts)

Dim OutApp As Object
Dim OutMail As Object


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

Dim xOutLook As Object
Dim xNmae As Object
On Error Resume Next
Set xOutLook = CreateObject("Outlook.Application")
Set xNmae = xOutLook.GetNamespace("MAPI")
semail = xNmae.Session.CurrentUser.AddressEntry.GetExchangeUser.PrimarySmtpAddress
On Error GoTo 0


On Error Resume Next
With OutMail
.SentOnBehalfOfName = "text@abc.com"
.Display
.To = dis_contacts
.cc = semail
.cc = rok_contacts

How do I combine the 2 .cc lines??
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Outlook 2013. Adding office 365 email account causes 'The operation failed' Using Outlook 2
P now on office 365 but getting error messages about missing Outlook 2013 cache folders Using Outlook 2
P Outlook 2013 search no longer works Using Outlook 2
K Closing external IMAP email... Outlook 2013 Using Outlook 0
P Outlook 2013 Calendar Archiving Using Outlook 0
T Compuserve, Yahoo, Oath2 and Outlook 2013 Using Outlook 4
Paula S. Outlook 2013 won't recognize new password Using Outlook 4
B Outlook 2013 erratically deleting original file that is attached Using Outlook 0
X Using Outlook 2013 and Outlook 365 Using Outlook 1
I Error saving screenshots in a custom form in outlook 2016, outlook 365 - ok in outlook 2013, outlook 2010 Outlook VBA and Custom Forms 5
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 10
Commodore Outlook (2013) issues with icloud.com mail Using Outlook 0
D iCloud Add-in not working in Outlook 2013 and Outlook 2016 After Windows Upgrade & iCloud Upgrade Using Outlook 2
P Outlook 2013 "Item could not be moved - still an issue for Outlook 2013 Using Outlook 0
M Creating an RSS Feed **FROM** Outlook 2013 Calendar. Using Outlook 5
D Outlook 2013 Yahoo IMAP Sync problems Using Outlook 1
iwshim outlook 2013 - I cannot see the "Manage Add-ins" Using Outlook 2
B Outlook 2013/Exchange 2013 - Conf Rooms not fully booking "resolved conflict" meetings Using Outlook 3
G Can't create Folder Groups in Outlook 2013 Using Outlook 0
A Run time error 424. object required in outlook 2013 Outlook VBA and Custom Forms 10
Rupert Dragwater Several questions regarding Outlook 2013 Using Outlook 9
P Outlook 2013 opens with FILE tab selected. Using Outlook 3
I How to display sender's name instead of email address in outlook 2013 message Using Outlook 5
Z Outlook 2013 Gmail IMPA emails not showing dates only showing times Using Outlook 1
B Forward every other email in Outlook 2013 Outlook VBA and Custom Forms 2
P Synching Outlook 2013 Notes with iPhone 8 Using Outlook 1
N Outlook 2013 Folder View Using Outlook 8
M Outlook 2013 fails to start -- missing WindowsCodecs.dll error Using Outlook 3
David Michaels Contact card shows blank Outlook 2013 Outlook VBA and Custom Forms 0
J Calendar data can be viewed on Outlook.com, but no longer syncs to Outlook 2013 Using Outlook.com accounts in Outlook 3
C Attached files on Outlook 2010 Sp1 & Exc 2013 are missing Exchange Server Administration 1
R Folders shifting around in Outlook 2013 and 2016 Using Outlook 3
P Sync Desktop Outlook 2013 with Outlook.com? Using Outlook.com accounts in Outlook 5
J Outlook 2013 when clicking To in a new email show Company names Using Outlook 0
J Outlook - 2013 - Error msg when copying folders from Online Archives to another user's mailbox Using Outlook 0
D Outlook 2013 changing iCloud reminder time? Using Outlook 0
M OUTLOOK 2013 CONTACT PROPERTIES Using Outlook 0
J Object Variable or With Block Not Set Error in Outlook 2016 and not Outlook 2013 Outlook VBA and Custom Forms 3
P Outlook 2013 puts replies in Outbox Using Outlook 1
P Contacts gone missing in Outlook 2013 POP Using Outlook 4
M Outlook 2013 Using Outlook 1
P MS OFFICE 2013 - Outlook locking up when using the sent on behalf of feature in VB Using Outlook 3
I Outlook 2010, 2013 will not open .msg or .eml files Using Outlook.com accounts in Outlook 1
Jeff Davis Help fix my Outlook 2013? Using Outlook 28
J Outlook 2013 hanging for unknown reason Using Outlook 1
O Outlook 2013 Problems sending large mails Using Outlook 4
K Rebuilding Outlook 2013 from Outlook.com after OS rebuild Using Outlook.com accounts in Outlook 2
O Windows 10 x64 Outlook 2013 - URL does not open (anymore) Using Outlook 3
J Will BCC messages still deliver if TO address fails Outlook 2013 Using Outlook 3
Liz Schneider PST from Outlook 2013 is now IMAP folders in 2016 Using Outlook 10

Similar threads

Back
Top