-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 に答える