Help!

Sending Outlook 2007 a Cc from an Excel macro - help 2

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Office applications RSS
Next:  Office - help 17  
Author Message
jb1320



Joined: Dec 02, 2011
Posts: 1



PostPosted: Fri Dec 02, 2011 11:23 pm    Post subject: Sending Outlook 2007 a Cc from an Excel macro


Using a macro in excel 2007, I'm sending an email based on worksheet cell contents. One cell to the "To", and the 2nd cell to the "Cc". The email sends ok, but both id's are on the To line. Below is my code. How can I fix? I'm using code I inherited, not an VBA programmer!

Dim OlApp As Object
Dim OlMail As Object
'Dim ToRecipient As String
'Dim CCRecipient As String

Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.createitem(olmailitem)


ToRecipient = Worksheets("Observation_email").Range("d4").Text
OlMail.Recipients.Add ToRecipient
CCRecipient = Worksheets("Observation_email").Range("d6").Text
OlMail.Recipients.Add CCRecipient
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Office applications All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum