Outlook add reference from file

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

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 eg 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.

链接地址: http://www.djcxy.com/p/63766.html

上一篇: 从Outlook 2016到2013的VBA代码更新

下一篇: Outlook从文件添加引用