ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel output to outlook? (https://www.excelbanter.com/excel-programming/276378-excel-output-outlook.html)

Josh Ashcraft

excel output to outlook?
 
I'm trying to email just the values of a range from my
worksheet. I don't want the cells to show up, only the
text. using the partial code i have below, what would be
the proper way to handle this?

Dim OLF As Outlook.MAPIFolder, olMailItem As
Outlook.MailItem
Dim ToContact As Outlook.Recipient
Set OLF = GetObject("", _
"Outlook.Application").GetNamespace
("MAPI").GetDefaultFolder(olFolderInbox)
Set olMailItem = OLF.Items.Add ' creates a new e-mail
message
With olMailItem
..Subject = "Banklist Status sheet for " & Date ' message
subject
Set ToContact = .Recipients.Add
") ' add a recipient

.Body = "Thank you for submitting, here are your
results." &(chr13) & right here is where i want the values
to be inserted...

Thanks in advance guys,
Josh





Bob Phillips[_5_]

excel output to outlook?
 
Josh,

You can just tag a range value on the end like so

.Body = "Thank you for submitting, here are your results." & Chr(13)
& Range("C11").Value

--

HTH

Bob Phillips

"josh ashcraft" wrote in message
...
I'm trying to email just the values of a range from my
worksheet. I don't want the cells to show up, only the
text. using the partial code i have below, what would be
the proper way to handle this?

Dim OLF As Outlook.MAPIFolder, olMailItem As
Outlook.MailItem
Dim ToContact As Outlook.Recipient
Set OLF = GetObject("", _
"Outlook.Application").GetNamespace
("MAPI").GetDefaultFolder(olFolderInbox)
Set olMailItem = OLF.Items.Add ' creates a new e-mail
message
With olMailItem
.Subject = "Banklist Status sheet for " & Date ' message
subject
Set ToContact = .Recipients.Add
") ' add a recipient

.Body = "Thank you for submitting, here are your
results." &(chr13) & right here is where i want the values
to be inserted...

Thanks in advance guys,
Josh








All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com