Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Defining the subject of an Email by value in range

Is this possible? I'm using this from Ron...


Code
-------------------
Dim strDate As String
Sheets("Quote").Copy
strDate = Format(Date, "dd-mm-yy")
ActiveWorkbook.SaveAs "Your Synthetic Shield " & ThisWorkbook.Name _
& " " & strDate & ".xls"
ActiveWorkbook.SendMail "", _
"This is the Subject line"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close Fals
-------------------


But I want the Subject line to be values from a range, is thi
possible

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Defining the subject of an Email by value in range

Sure
http://www.rondebruin.nl/sendmail.htm#Tips


--
Regards Ron de Bruin
http://www.rondebruin.nl


"RPIJG " wrote in message ...
Is this possible? I'm using this from Ron...


Code:
--------------------
Dim strDate As String
Sheets("Quote").Copy
strDate = Format(Date, "dd-mm-yy")
ActiveWorkbook.SaveAs "Your Synthetic Shield " & ThisWorkbook.Name _
& " " & strDate & ".xls"
ActiveWorkbook.SendMail "", _
"This is the Subject line"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
--------------------


But I want the Subject line to be values from a range, is this
possible?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Defining the subject of an Email by value in range

Ok, so now I'm using


Code
-------------------
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy ")
Application.ScreenUpdating = False
Sheets("Quote").Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Quote " & ThisWorkbook.Name _
& " " & strdate & ".xls"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Your Synthetic Shield Invoice for your " + Sheets("Quote").Range("E47").Text + Sheets("Quote").Range("E49").Text + Sheets("Quote").Range("E51").Text
.Body = "Here is your Synthetic Shield Invoice as you requested. Thanks Again for your service."
.Attachments.Add wb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothin
-------------------


and I'm recieving an error at the DimApp line (the first line),
checked to make sure I had made the reference and it was there? wher
have I gone wrong

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Defining the subject of an Email by value in range

RPIJG

What is the error you are getting? Check the references again. Make sure
there is a check next to Microsoft Outlook x.0 Object Library. Just
selecting the entry doesn't set the reference, you have to put a check by
it. Also, don't confuse it with Microsoft Office x.0 Object Library.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"RPIJG " wrote in message
...
Ok, so now I'm using


Code:
--------------------
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy ")
Application.ScreenUpdating = False
Sheets("Quote").Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Quote " & ThisWorkbook.Name _
& " " & strdate & ".xls"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Your Synthetic Shield Invoice for your " +

Sheets("Quote").Range("E47").Text + Sheets("Quote").Range("E49").Text +
Sheets("Quote").Range("E51").Text
.Body = "Here is your Synthetic Shield Invoice as you requested. Thanks

Again for your service."
.Attachments.Add wb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
--------------------


and I'm recieving an error at the DimApp line (the first line), I
checked to make sure I had made the reference and it was there? where
have I gone wrong?


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Defining the subject of an Email by value in range

.Subject = "Your Synthetic Shield Invoice for your " + Sheets("Quote").Range("E47").Text + Sheets("Quote").Range("E49").Text +
Sheets("Quote").Range("E51").Text

Instead of + use &

--
Regards Ron de Bruin
http://www.rondebruin.nl


"RPIJG " wrote in message ...
Ok, so now I'm using


Code:
--------------------
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy ")
Application.ScreenUpdating = False
Sheets("Quote").Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Quote " & ThisWorkbook.Name _
& " " & strdate & ".xls"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Your Synthetic Shield Invoice for your " + Sheets("Quote").Range("E47").Text + Sheets("Quote").Range("E49").Text +

Sheets("Quote").Range("E51").Text
.Body = "Here is your Synthetic Shield Invoice as you requested. Thanks Again for your service."
.Attachments.Add wb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
--------------------


and I'm recieving an error at the DimApp line (the first line), I
checked to make sure I had made the reference and it was there? where
have I gone wrong?


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Defining the subject of an Email by value in range

Yeah I didn't set the reference right...and I used the & instead of + i
works great now, thanks everyone for all of your help

--
Message posted from http://www.ExcelForum.com

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
Email subject Arun Excel Discussion (Misc queries) 0 December 27th 06 08:27 PM
Auto email from excel with custom subject Vikram Excel Discussion (Misc queries) 12 July 28th 06 03:42 AM
Using VB, specific cell data into email subject andrew Excel Discussion (Misc queries) 1 January 26th 05 05:53 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 05:27 PM.

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

About Us

"It's about Microsoft Excel"