代码在Outlook 2010中正常工作,但在2003年没有 [英] Code working fine in Outlook 2010 but not 2003

查看:71
本文介绍了代码在Outlook 2010中正常工作,但在2003年没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在这些论坛上提出了一个问题,警告您是否通过电子邮件发送卡号,Graham Mayor请提供以下代码。这在Outlook 2010上运行得很好,但是当我尝试在Outlook 2003上使用它时,它似乎无法正常工作。

I recently asked a question on these forums to warn if you are sending card numbers via email, and Graham Mayor kindly provided the below code. This worked nicely on Outlook 2010, however when I tried to use it on Outlook 2003 it doesn't appear to work.

我已经浏览了一下,人们提到使用后期绑定解决这个问题。我自己没有成功整理出来,所以任何帮助都会受到赞赏。显然,如果有一种更简单的方法来解决这个问题,那就太棒了。
(不幸的是升级是不可能的!)

I've had a look around and people have mentioned using late binding to get around this issue. I've had no success in sorting this out myself, so any assistance would be appreciated. Obviously if there is an easier way to sort this out, that would be great. (Unfortunately upgrading is not a possibility!)

正如我所提到的,它适用于带有VBA 7的Outlook 2010(带有Microsoft Office 14对象库)但不适用于带有VBA 6.5和对象库11的Outlook 2003.

As I mentioned it worked on Outlook 2010 with VBA 7 (with Microsoft Office 14 Object Library) but not on Outlook 2003 with VBA 6.5 and object library 11.

Private Sub Application_ItemSend _

        (ByVal Item As Object,Cancel As Boolean)

Dim strMsg As String

Dim i As Long

Dim strtext As String

如果AutomateReplyWithSearchString = True则为
   取消=真实
    strMsg ="此消息包含卡或帐号。请在发送前删除!"
$
    MsgBox strMsg,_
$
           vbExclamation + vbSystemModal," Content Warning"

结束如果

Item.Display

Set Item = Nothing

结束Sub

Private Sub Application_ItemSend _
        (ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim i As Long
Dim strtext As String
If AutomateReplyWithSearchString = True Then
    Cancel = True
    strMsg = "This message contains card or account numbers. Please remove before sending!"
    MsgBox strMsg, _
           vbExclamation + vbSystemModal, "Content Warning"
End If
Item.Display
Set Item = Nothing
End Sub

并在普通模块中插入以下函数代码

and in an ordinary module, insert the following function code

感谢预期

推荐答案

此论坛适用于Visual Studio Net中的VB

This forum is for VB in visual Studio Net

您的问题适用于VB for Application。 

Your problem is for VB for Application. 

它有自己的论坛

http://social.msdn.microsoft.com/Forums/en-US/isvvba


这篇关于代码在Outlook 2010中正常工作,但在2003年没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆