1、outlook中 alt+F11
2、写入下列代码
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If TypeName(Item) <> "MailItem" Then Exit Sub
If Item.Subject = "" Then
Msg = "这个邮件没有主题!继续?" ‘定义消息文本
Style = vbYesNo + vbCritical + vbDefaultButton2 ‘定义对话框样式
Title = "错误信息" ‘定义标题文本
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ‘用户按下“是”按钮
Cancel = False ‘进行某些操作
Else ‘用户按下“否”按钮
Cancel = True ‘进行某些操作
End If
End If
End Sub
时间: 2024-10-09 13:48:52