Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Opening a new mail dialog box in Excel using vba

Hi,

I would like to use Excel that runs a macro to open up a
new mail in Outlook. I would also like to put in a
generic body message and subject line, but they would
have to be able to pick who they would like to email it
to as it different everytime. I can only do this if they
were sending the file along with it, but is there anyway
of doing this without attaching the file?

Any help would be much appreciated.

Michelle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Opening a new mail dialog box in Excel using vba

Hi Michelle,

I would like to use Excel that runs a macro to open up a
new mail in Outlook.


Like this:

Sub MailIt()
Dim oMailItem As Object
Dim oOLapp As Object
Set oOLapp = CreateObject("Outlook.application")
Set oMailItem = oOLapp.CreateItem(0)
With oMailItem
.To =
.CC =
.Subject = "Your subject goes here"
.Body = "Hi there!"
.Display
End With
Set oOLapp = Nothing
Set oMailItem = Nothing
End Sub


Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Opening a new mail dialog box in Excel using vba


Set OL = CreateObject("Outlook.Application")
Set emlMessage = Outlook.CreateItem(olMailItem)
emlMessage.Attachments.Add "filename"
emlMessage.Subject = "title"
'emlMessage.To = "whoever"
emlMessage.Display

You'll need the outlook reference added via toolsreference in the vb
editor.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Opening a new mail dialog box in Excel using vba

Hi Jan,

Thank you very much for your response.
That's exactly what I want to do!!

Regards,

Michelle

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Opening Excel - getting print dialog box Christina Lynch Excel Discussion (Misc queries) 0 August 31st 08 01:40 AM
Dialog box appears when opening Excel says it can't find a file? Aloha6 Excel Discussion (Misc queries) 2 September 12th 06 01:03 PM
how do i create a dialog box to appear on opening an excel wkbook lallyboo Excel Discussion (Misc queries) 1 October 13th 05 06:52 PM
How can I make Excel display a message (dialog box) upon opening a spreadsheet? Phill Excel Discussion (Misc queries) 8 March 20th 05 06:22 PM
Opening an filling e-mail from excel JMay Excel Programming 0 September 8th 03 12:52 PM


All times are GMT +1. The time now is 12:24 AM.

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"