通过 VBA 打开位于 Lotus Notes 数据库中的 Excel 文件附件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11612041/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 17:00:10  来源:igfitidea点击:

Opening an Excel file attachment located in a Lotus Notes Database through VBA

excelvbaexcel-vbahyperlinklotus-notes

提问by user1545751

I am trying to automate the opening of an excel file located in a jobs database within lotus notes. I have been able to open up a window in lotus notes using the url, but I can't open the file located there automatically as it is an attachment.

我正在尝试自动打开位于 Lotus Notes 作业数据库中的 excel 文件。我已经能够使用 url 在 lotus notes 中打开一个窗口,但是我无法自动打开位于那里的文件,因为它是一个附件。

This is the vba code I am using to open the link:

这是我用来打开链接的 vba 代码:

Application.ActiveWorkbook.FollowHyperlink Address:="Notes://URL", NewWindow:=True

What is the proper way to do it?

什么是正确的方法呢?

回答by Ken Pespisa

You'll need to use VBA to access Lotus Notes via COM. Then you can get at the NotesEmbeddedObject, save it using the ExtractFile method, and then launch that saved copy.

您需要使用 VBA 通过 COM 访问 Lotus Notes。然后您可以访问 NotesEmbeddedObject,使用 ExtractFile 方法保存它,然后启动保存的副本。

An example of VBA using Notes COM API: http://www.vbafin.com/Lotus-Notes-VBA-code.php

使用 Notes COM API 的 VBA 示例:http: //www.vbafin.com/Lotus-Notes-VBA-code.php

There's a document on IBM's site that will help you get started:

IBM 网站上有一份文档可以帮助您入门:

How to use LotusScript classes with Visual Basic

如何在 Visual Basic 中使用 LotusScript 类