ユーザーが新しい空白のメッセージを作成したときにOutlook2003マクロを発射します
-
01-10-2019 - |
質問
ユーザーがメッセージを受信したり、送信ボタンにヒットしたりしたときに発射するイベントを見つけましたが、ユーザーが空白の新しい電子メールを作成するときに発射するものはありません。
解決
NewInspectorイベントを使用できるはずです。例:
Public WithEvents myOlInspectors As Outlook.Inspectors
Private Sub Application_Startup()
Initialize_handler
End Sub
Public Sub Initialize_handler()
Set myOlInspectors = Application.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
Dim msg As Outlook.MailItem
If Inspector.CurrentItem.Class = olMail Then
Set msg = Inspector.CurrentItem
If msg.Size = 0 Then
MsgBox "New message"
End If
End If
End Sub
所属していません StackOverflow