-1
Sub Mail_Workbook()

Dim wb As Workbook
Set wb = ActiveWorkbook
Application.Wait (Now + TimeValue("0:00:06"))
Application.SendKeys "{TAB}", "false"
Application.SendKeys "{TAB}", "false"
Application.SendKeys "{ENTER}"

If Val(Application.Version) >= 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file that will be removed if you try to send this file." & vbNewLine & _
  "Save the file first as xlsm and then try the macro again.", vbInformation
  Exit Sub
  End If
  End If

On Error Resume Next
   For I = 1 To 3
      wb.SendMail Array("email.person@company.com", "email.person2@company.com"), "Test VBA"
      If Err.Number = 0 Then Exit For
   Next I
On Error GoTo 0
End Sub
4

1 回答 1

2

您需要查看 Outlook Redemption:

http://www.dimastr.com/redemption/home.htm

此工具允许您绕过 Outlook 的安全限制。以下是产品网站上的一些示例代码:

http://www.dimastr.com/redemption/SafeMailItem.htm

有用。

于 2013-05-15T19:50:00.623 回答