Outlook从文件添加参考 [英] Outlook add reference from file

查看:91
本文介绍了Outlook从文件添加参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Outlook中创建了需要Word和Excel引用的宏.它必须在不同版本的Office上工作(2007、2010、2013).我有Office 2013,因此当我在2007年和2010年安装"宏(复制VBAProject.otm)时,缺少参考.我想使用类似于Excel中的代码手动添加引用:

I created a macro in Outlook which needs Word and Excel references. It has to work on different versions of Office (2007, 2010, 2013). I have Office 2013, so when I "install" macro (copy VBAProject.otm) on 2007 and 2010 I have missing references. I wanted to add references manually using code similar to this in Excel:

ThisWorkbook.VBProject.References.AddFromFile

但是我找不到那样的东西.我搜索了互联网,但也失败了. 谁能告诉我在Outlook VBA中是否可以从文件添加引用?

but I couldn't find anything like that. I searched internet, but I also failed. Can anyone tell me if in Outlook VBA is possible to add reference from file?

推荐答案

要使用未引用的库并避免在每个用户的计算机上设置引用,您可以通过

To use unreferenced libraries and avoid setting references on each users' computer you access them by creating objects via late binding. This is typically done using the CreateObject method e.g for the scripting runtime you'd use:

Dim fso as object

Set fso = CreateObject("Microsoft.ScriptingRuntime")

您可以在线搜索如何后期绑定所需的特定参考.

You can search online for how to late bind the particular reference you require.

这篇关于Outlook从文件添加参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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