Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 224
Default Dialogs(xlDialogSendMail).Show - how to delete attachment?

I'm using a line like this to allow the user to easilty send me an
email:

Application.Dialogs(xlDialogSendMail).Show ", "My
subject"

But it automatically attaches an Excel workbook file. With some older
versions of Excel (I don't recall which versions), I was able to
delete the attachment with sendkeys:

SendKeys "{TAB}{TAB}{TAB}{DELETE}"
Application.Dialogs(xlDialogSendMail).Show ", "My
subject"

But that doesn't work anymore, at least not since Excel 2003.

Is there a way to get rid of that attachment, without the user needing
to manually delete it?


Thanks,

Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Dialogs(xlDialogSendMail).Show - how to delete attachment?

Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Public Declare Function GetDesktopWindow Lib "user32" () As Long

Sub preEmail()
Dim sEmail As String

sEmail = "mailto:" & "
sEmail = sEmail & "?subject=The subject"
sEmail = sEmail & "&Body=" & "some body text"
sEmail = sEmail & "%20"

nRes = ShellExecute(GetDesktopWindow(), vbNullString, _
sEmail, vbNullString, _
vbNullString, vbNormalFocus)

End Sub

Regards,
Peter T

"Greg Lovern" wrote in message
...
I'm using a line like this to allow the user to easilty send me an
email:

Application.Dialogs(xlDialogSendMail).Show ", "My
subject"

But it automatically attaches an Excel workbook file. With some older
versions of Excel (I don't recall which versions), I was able to
delete the attachment with sendkeys:

SendKeys "{TAB}{TAB}{TAB}{DELETE}"
Application.Dialogs(xlDialogSendMail).Show ", "My
subject"

But that doesn't work anymore, at least not since Excel 2003.

Is there a way to get rid of that attachment, without the user needing
to manually delete it?


Thanks,

Greg



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 224
Default Dialogs(xlDialogSendMail).Show - how to delete attachment?

Wow, thanks! That's great.

Greg

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
Dialogs(xlDialog...).Show arguments usage Peter E Excel Programming 1 February 9th 08 11:15 AM
Application.Dialogs(xlDialogPrint).Show - prints too soon Almagg via OfficeKB.com Excel Discussion (Misc queries) 3 April 27th 07 08:17 PM
returning values application.dialogs(...).show Pringles. Excel Programming 2 July 31st 06 04:11 PM
Application.Dialogs(xlDialogSendMail).Show James T Excel Programming 1 July 18th 06 03:34 AM
Problems with application.Dialogs(xlDialogFormulaFind).Show lydya Excel Programming 2 December 18th 04 05:02 PM


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