Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default SaveAs function and Send mail in VBA

Hi,

I found the below coding, (which I am very greatful for, thank Tim)
however, I can't seem to get it working after the few amendments I have

made. In my mind I see two steps I need help on. The save as function
that works in another workbook, but not this one. I would like to have
the SaveAs box open already in the Root drive/folder of the office,
allowing the user to then chose which sub folder they wish. Second step

it to the send the attachment with the new name as the subject, then
include a standard response in the body?


I hope this all makes sense... it is 230 am and I am seeing squares,
just can't get this last bit working....


Many Thanks in advance.


Craigy


Sub Send_Mail_Test()
' Courtesy Tim Zych - 08/09/2000
Dim ol As Object
Dim mailitem As Object


Set ol = CreateObject("Outlook.Application")
Set mailitem = ol.CreateItem(olMailItem)
Set wb = ActiveWorkbook
With wb
SaveAsName = ("E Billing" & " " & "A" & Range("L6").Text & " " &
"Consumption" & " " & Range("L8").Text & " " & Range("A30").Text)
..SaveAs = SaveAsName


With mailitem
.To = ""
.CC = ""
.Subject = SaveAsName
.Body = "Please find attached your E Billing for this month."


.Attachments.Add wb.FullName
.Display
' .Send
End With


Set ol = Nothing
Set mailitem = Nothing


End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default SaveAs function and Send mail in VBA

Hi Craigy

See the VBA help for GetSaveAsFilename

See my site for a lot of code and post back
http://www.rondebruin.nl/sendmail.htm


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



wrote in message oups.com...
Hi,

I found the below coding, (which I am very greatful for, thank Tim)
however, I can't seem to get it working after the few amendments I have

made. In my mind I see two steps I need help on. The save as function
that works in another workbook, but not this one. I would like to have
the SaveAs box open already in the Root drive/folder of the office,
allowing the user to then chose which sub folder they wish. Second step

it to the send the attachment with the new name as the subject, then
include a standard response in the body?


I hope this all makes sense... it is 230 am and I am seeing squares,
just can't get this last bit working....


Many Thanks in advance.


Craigy


Sub Send_Mail_Test()
' Courtesy Tim Zych - 08/09/2000
Dim ol As Object
Dim mailitem As Object


Set ol = CreateObject("Outlook.Application")
Set mailitem = ol.CreateItem(olMailItem)
Set wb = ActiveWorkbook
With wb
SaveAsName = ("E Billing" & " " & "A" & Range("L6").Text & " " &
"Consumption" & " " & Range("L8").Text & " " & Range("A30").Text)
.SaveAs = SaveAsName


With mailitem
.To = ""
.CC = ""
.Subject = SaveAsName
.Body = "Please find attached your E Billing for this month."


.Attachments.Add wb.FullName
.Display
' .Send
End With


Set ol = Nothing
Set mailitem = Nothing


End Sub



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
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Send an e-mail Pa Maher Excel Discussion (Misc queries) 1 September 16th 07 04:27 PM
Send e-mail Andrea Excel Discussion (Misc queries) 3 March 25th 07 12:37 PM
Send e-mail with CDO Luciano Excel Programming 0 January 12th 05 09:15 AM
Send Mail janet Excel Programming 2 July 22nd 03 10:06 PM


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