A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Mailing a sheet without saving before



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 3rd 06, 07:00 PM posted to microsoft.public.outlook.program_vba
WMR
external usenet poster
 
Posts: 2
Default Mailing a sheet without saving before

Hello,

I made a program in Excel that mails the Activesheet.
For each email I add the name of the repicient. So it is personalized. I
want to use a specific Outlook template.

To do this, I have to save my Excelsheet first. But that takes a lot of time.
So, I want to send my email without saving.

I use the following code.

Sub SendMyEmail()

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItemFromTemplate _
("C:\Templates\WMR.oft")

Set wb = Workbooks(Active_Excel_File)
With wb
.SaveAs "C:\Temp\" & MySubject & " " & MyDate & ".xls"

With OutMail
.To = email
.Subject = MySubject & " " & MyDate
.Attachments.Add wb.FullName
.Send
End With

.ChangeFileAccess xlReadOnly

Kill wb.FullName

Set OutMail = Nothing
Set OutApp = Nothing

End With

End Sub

Who can help me out?
Thanks a lot!

Willem

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mailing pictures dalenherb Outlook Express 15 March 5th 06 12:52 AM
creating a fax cover sheet from outlook Sandman Outlook - Using Contacts 2 February 21st 06 05:15 PM
Mailing labels and merging KathrynBassett Outlook - Using Contacts 3 February 16th 06 12:26 AM
How do I print some Outlook Contacts to a sheet of 3 x 5 Index Car tinacscs Outlook - Using Contacts 1 February 3rd 06 01:31 AM
allow me to print a fax cover sheet directly from a contact's info kdzzack Outlook - Using Contacts 0 January 30th 06 08:31 PM


All times are GMT +1. The time now is 08:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.