LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default filename in "Subject" in email

Hi I have:

Dim Fname As Variant

Fname = Application.GetSaveAsFilename("c:\MESSER\" &
Range("mesnum").Value & "_" & Replace(Range("filedate").Value, "/", "") &
".csv")

This works well, then: note the .Subject line...I am trying to use the Fname
from above in the Subject line. How is that possible? right now I get the
rest but not the Fname

Sub Mail_Selection_Outlook_Body()
' You must add a reference to the Microsoft outlook Library
' Don't forget to copy the function RangetoHTML in the module.

Dim sh As Worksheet
Dim rng As Range
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem

'If you know the sheet/range then use this two lines
Set sh = Sheets("START")
Set rng = sh.Range("head")

Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = "
.Subject = Fname & "_" & " now is in \\Cav_New\Files"
.HTMLBody = RangetoHTML(sh, rng)
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True

 
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
Subject: how to convert 112" to 9'4" with a formula in Excel Mike H Excel Worksheet Functions 2 August 3rd 08 03:22 PM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
textbox value to be used as a "subject" line within an email excelwatcher Excel Worksheet Functions 0 March 7th 06 04:30 AM
Subject: Not showing "info on clipboard" message Gord Dibben[_3_] Excel Programming 0 July 25th 03 10:15 PM


All times are GMT +1. The time now is 08:17 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"