删除 Outlook 项目中的模块 [英] Delete a Module in Outlook Project

查看:17
本文介绍了删除 Outlook 项目中的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以删除 Outlook VBA 模块吗?

Can I delete an Outlook VBA Module?

我已经尝试了以下代码:

I have tried the below code:

Dim vbMod As Object

Set vbMod = Application.VBE.ActiveVBProject.VBComponents
vbMod.Remove VBComponent:=vbMod.Item("Module2")

但出现错误:

438 错误,对象不支持此属性或方法

438 Error, Object doesn't support this property or method

这可以用 Outlook VBA 完成吗?是否有任何参考资料要包括在内?

Can this be done with Outlook VBA and are there any References to be included?

推荐答案

您的答案是否定的,我们无法删除甚至以编程方式访问 VBIDE;您可以添加对 Microsoft Visual Basic for Applications Extensibility 5.3 的引用是正确的,但无济于事.

The answer to your answer is no, we can't delete or even access programmatically the VBIDE; it is correct that you can add reference to Microsoft Visual Basic for Applications Extensibility 5.3, but to no avail.

如果您在 Word 或 Excel 中尝试此操作,则输出如下:

If you try this at Word or Excel, this is the output:

但是,当您在 Outlook 中尝试此操作时,不会暴露 VBE:

But, when you try this at Outlook, VBE is not exposed:

这里是一个确认.也许在较旧的 Outlook 版本中,不太安全,您可以这样做,但至少因为 Outlook 2002,这是不可能的.

Here is a confirmation. Maybe in older Outlook versions, less safer, you could do that, but at least since Outlook 2002, it is not possible.

这篇关于删除 Outlook 项目中的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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