Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CC: Sender on Email

Status
Not open for further replies.

wiginprov

Technical User
May 5, 2001
35
US
I have the following macro to send a workbook to a specific individual:

ActiveWorkbook.SendMail Recipients:="Smith, Joe"

How do I cc: the sender, which could be one of 150 possible individuals?

Any thoughts appreciated. Many thanks.
 
your going to need to use the Outlook module, so goto tools references and select then your code might be something like this


Sub emailReport()
On Error Resume Next

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookAttach As Outlook.AttachmentSet objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg

.to ="Joebloggs@joe.com"
.cc ="Frank@joe.com"
.subject ="how to mail"
.body ="make sense >?"
.Attachments.Add "C:\temp\myspreadhseet.xls", olByValue, 1, "Rich Text Report"
.send

end with


 
That looks great, but my sender could be one of 150 people, not consistently the same individual. How do I grab the sender's identity and cc them?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top