Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
email hyperlink - cell value in subject line boustrophedon Excel Discussion (Misc queries) 19 April 21st 23 06:12 PM
Export data in cell as the subject line in an email BCassedy Excel Worksheet Functions 0 July 26th 07 10:10 PM
Subject line in email defaults to workbook file name. swellett Excel Discussion (Misc queries) 0 March 17th 06 04:55 PM
Subject line in email defaults to workbook file name. swellett Excel Discussion (Misc queries) 2 March 17th 06 04:35 PM
Code to Email with UNC in subject line Sandy[_3_] Excel Programming 1 July 14th 03 02:10 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"