我想知道如何使用Windows(不是Outlook)中的默认电子邮件程序(通过按钮)将excel文件(此按钮位于其中)作为电子邮件的附件添加
到目前为止,我发现了这个
Option Explicit
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
Sub send_mail()
Dim objMail As String
Dim oMailSubj, oMailTo, oMailBody, oMailAttach As String
oMailSubj = "subject"
oMailTo = "adress@adress.com"
oMailBody = "BLAH BLAH!!!!"
objMail = "mailto:" & oMailTo & "?subject=" & oMailSubj & "&body=" & oMailBody
ShellExecute 0, vbNullString, objMail, vbNullString, vbNullString, vbNormalFocus
End Sub
效果很好,这就是我的期望。
最后的想法是保存文件并将其附加到电子邮件中。
到目前为止我找不到任何解决方案。
预先感谢您的帮助。