询问者
outlook2010在发信时,忘记贴附件了,应该怎么避免呢?怎样才能让outlook提示,是否需要添加附件?

问题
全部回复
-
Hi jiawei,
本论坛是讨论关于VB 语法,编译器,VB构架/运行时,包括语法关键字和自定义的命名空间。我不太确定你的问题是关于vb开发还是outlook的开发问题, 或者outlook的简单应用问题,请帮忙确认一下问题。
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
请参考这篇文章
Outlook 提醒信件 Title, 附件 是否忘记加上 -
Hi jiawei.peng
您也可以参考这篇文章, 里面有详细的步骤.
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已编辑 Cherry BuMicrosoft contingent staff, Moderator 2018年1月11日 1:41
- 已建议为答案 Stanly Fan 2018年1月11日 1:42
-
这篇上面写了说是outlook2007上才通过,我根据上面提示试了一下,outlook 2010 上不能实现
- 已编辑 jiawei.peng 2018年1月11日 2:49
-
Hi jiawei.peng,
我已经在outlook 2010上面测试了, 上面的方案是可行的。
(1)打开Outlook;
(2)按Alt + F11打开VBA;
(3)点击左侧树状目录最下面的“ThisOutlookSession”,看到右边出现空白的编辑窗口;
(4)把上面的代码复制到编辑窗口,保存即可。不用重启Outlook.假如你新建一个新的email,填写了地址和主题, 在下面的正文中涉及到“附件”两个字,但是没有添加附件直接点击发送的话, 你就会收到如下提醒。
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
你好,
这是我上面link中提到的代码:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) ' 只检查邮件类型 If TypeName(Item) <> "MailItem" Then Exit Sub Dim intRet As Integer Dim strMsg As String ' 空主题? If Item.Subject = "" Then strMsg = "您的邮件缺少主题,返回填写吗?" & vbCrLf & "没有主题的邮件可不礼貌哦~" intRet = MsgBox(strMsg, vbYesNo + vbExclamation, "缺少主题") If intRet = vbYes Then Cancel = True Exit Sub End If End If ' 忘了帖附件? Dim intRes As Integer Dim strThismsg As String Dim intOldmsgstart As Integer Dim sSearchStrings(2) As String Dim bFoundSearchstring As Boolean Dim i As Integer ' 指定提示邮件可能需要附件的词 bFoundSearchstring = False ' 英文邮件 sSearchStrings(0) = "attach" sSearchStrings(1) = "enclose" ' 中文邮件 sSearchStrings(2) = "附件" ' 对于转发和回复的邮件,不要到信末附的邮件原文进行搜索 ' 纯文本格式的原文信头是“Original Message”或“邮件原件”,但HTML格式的回复没有 intOldmsgstart = InStr(Item.Body, "发件人:") ' 如果在邮件国际选项中打开了“答复和转发时邮件头使用英语”,则应该搜索英文信头 ' intRes作为临时变量 intRes = InStr(Item.Body, "From:") ' 对于多次回复和转发又有多种语言的情况,总是选择最上一封 If intRes > 0 Then If (intOldmsgstart = 0) Or (intOldmsgstart > 0 And intRes < intOldmsgstart) Then intOldmsgstart = intRes End If End If If intOldmsgstart = 0 Then ' 不是Re/Fw的邮件则搜索邮件全文和主题 strThismsg = Item.Body + " " + Item.Subject Else ' 是Re/Fw的邮件则只搜索用户写的部分和邮件主题 strThismsg = Left(Item.Body, intOldmsgstart) + " " + Item.Subject End If ' 搜索邮件正文(和主题)中所有可能提示邮件需要附件的词 For i = LBound(sSearchStrings) To UBound(sSearchStrings) If InStr(LCase(strThismsg), sSearchStrings(i)) > 0 Then bFoundSearchstring = True Exit For End If Next i If bFoundSearchstring Then If Item.Attachments.Count = 0 Then strMsg = "您的邮件可能缺少附件!" & vbCrLf & "是否仍要发送?" intRet = MsgBox(strMsg, vbYesNo+vbDefaultButton2+vbExclamation, "缺少附件") If intRet = vbNo Then Cancel = True Exit Sub End If End If End If End Sub
(1)打开Outlook;
(2)按Alt + F11打开VBA;
(3)点击左侧树状目录最下面的“ThisOutlookSession”,看到右边出现空白的编辑窗口;
(4)把上面的代码复制到编辑窗口,保存即可。不用重启Outlook.如果你的outlook是中文版本的话,按照上面的步骤操作, 我这边是可以工作的。
假如你新建一个新的email,填写了地址和主题, 在下面的正文中涉及到“附件”两个字,但是没有添加附件直接点击发送的话, 你就会收到提醒。
如果你的outlook的英文版本的话,你不需要任何操作, 新建一个新的email, 填写地址和主题, 在下面正文中涉及“Attachment”这个单词, 但是没有添加附件直接点击发送的话, 你也会收到提醒。
Best Regards,
Cherry
Best Regards,
Cherry
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已建议为答案 Stanly Fan 2018年1月11日 9:17
-
-
Hi jiawei,
如果Kunmo的方案对你有用,请将这个解决方案标记为答案,这样有助于其他有需要的人快速找到这个方案。
谢谢。
Regards,
Stanly
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.