ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing subject line in email (https://www.excelbanter.com/excel-programming/363570-changing-subject-line-email.html)

tanyhart[_6_]

Changing subject line in email
 

I've have a macro that will send a generic email from Excel.. My nex
problem in that I would like the subject of each email to reflect th
infomation that are in two different cells of the workbook (say C5 an
C7 of sheet1). How would I enter this in the macro to accomplish thi
task?

Thanks

--
tanyhar
-----------------------------------------------------------------------
tanyhart's Profile: http://www.excelforum.com/member.php...fo&userid=3514
View this thread: http://www.excelforum.com/showthread.php?threadid=54949


Norman Jones

Changing subject line in email
 
Hi Tanya,

See the tips section on any of Ron de Bruin's email pages.

http://www.rondebruin.nl/sendmail.htm


---
Regards,
Norman



"tanyhart" wrote in
message ...

I've have a macro that will send a generic email from Excel.. My next
problem in that I would like the subject of each email to reflect the
infomation that are in two different cells of the workbook (say C5 and
C7 of sheet1). How would I enter this in the macro to accomplish this
task?

Thanks.


--
tanyhart
------------------------------------------------------------------------
tanyhart's Profile:
http://www.excelforum.com/member.php...o&userid=35148
View this thread: http://www.excelforum.com/showthread...hreadid=549499




Tom Ogilvy

Changing subject line in email
 
Dim s as String
With worksheets("Sheet1")
s = .Range("A1").Text & " " & .Range("B9").Text
End With
. . . Subject:=s, . . .

--
Regards,
Tom Ogilvy


"tanyhart" wrote:


I've have a macro that will send a generic email from Excel.. My next
problem in that I would like the subject of each email to reflect the
infomation that are in two different cells of the workbook (say C5 and
C7 of sheet1). How would I enter this in the macro to accomplish this
task?

Thanks.


--
tanyhart
------------------------------------------------------------------------
tanyhart's Profile: http://www.excelforum.com/member.php...o&userid=35148
View this thread: http://www.excelforum.com/showthread...hreadid=549499



tanyhart[_8_]

Changing subject line in email
 

Tom,

When I enter that into the macro and run it, I get a run-time error 9
Subscript out of range. Perhaps I have it in the wrong place.

ub Mail_small_Text_Outlook()
'You must add a reference to the Microsoft outlook Library
Dim myOutlook As Object
Dim myMailItem As Object
Dim strbody As String
Dim s As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "XXXXX" & vbNewLine & vbNewLine & _
"Your request for estimate has been received and is i
progress." & vbNewLine & vbNewLine & _
"I have been assigned the responsibility to coordinat
the return and will try to have the estimate returned to you by XXXX.
& vbNewLine & _
"If the estimate can not be delivered by this date, yo
will be notified."

With Worksheets("Sheet1")
s = .Range("A1").Text & " " & .Range("B9").Text
End With

With OutMail
.to = ""
.CC = ""
.BCC = ""
.Subject = s
.Body = strbody
.Display
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Su

--
tanyhar
-----------------------------------------------------------------------
tanyhart's Profile: http://www.excelforum.com/member.php...fo&userid=3514
View this thread: http://www.excelforum.com/showthread.php?threadid=54949


tanyhart[_9_]

Changing subject line in email
 

Disregard, I figured it out.

Thanks for your help

--
tanyhar
-----------------------------------------------------------------------
tanyhart's Profile: http://www.excelforum.com/member.php...fo&userid=3514
View this thread: http://www.excelforum.com/showthread.php?threadid=54949



All times are GMT +1. The time now is 11:49 PM.

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