Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i use this code from ron's
how can i get the current date and time from the system to go in the subject line? ---------------------------------------------------------------------------------------------- i need something like .Subject = "inventory movement for 13/02/08 21:08pm" ----------------------------------------------------------------------------------------------- Set rng = Sheets("data capture").UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = RangetoHTML(rng) .display 'or use .Send End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just did this last week. I can't test it now, but as I recall it was
something like this: .Subject = "This is the Subject line" & " " & Format(Now, "hh:mm:ss") & " " & Format(Date, "dd/mm/yyyy") .Subject = "This is the Subject line" & " " & Now() & " " & Date() Something along those lines. You need the ampersand; that's the key. Regards, Ryan--- -- RyGuy "pswanie" wrote: i use this code from ron's how can i get the current date and time from the system to go in the subject line? ---------------------------------------------------------------------------------------------- i need something like .Subject = "inventory movement for 13/02/08 21:08pm" ----------------------------------------------------------------------------------------------- Set rng = Sheets("data capture").UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = RangetoHTML(rng) .display 'or use .Send End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanx...
worked like a charm.. "ryguy7272" wrote: I just did this last week. I can't test it now, but as I recall it was something like this: .Subject = "This is the Subject line" & " " & Format(Now, "hh:mm:ss") & " " & Format(Date, "dd/mm/yyyy") .Subject = "This is the Subject line" & " " & Now() & " " & Date() Something along those lines. You need the ampersand; that's the key. Regards, Ryan--- -- RyGuy "pswanie" wrote: i use this code from ron's how can i get the current date and time from the system to go in the subject line? ---------------------------------------------------------------------------------------------- i need something like .Subject = "inventory movement for 13/02/08 21:08pm" ----------------------------------------------------------------------------------------------- Set rng = Sheets("data capture").UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = RangetoHTML(rng) .display 'or use .Send End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
email hyperlink - cell value in subject line | Excel Discussion (Misc queries) | |||
Changing subject line in email | Excel Programming | |||
Subject line in email defaults to workbook file name. | Excel Discussion (Misc queries) | |||
How do I include cell data in subject line of email address/hyperl | Excel Worksheet Functions | |||
Code to Email with UNC in subject line | Excel Programming |