无法从 VBA (Word) 实例化 NotesUIWorkspace [英] Cannot instanciate a NotesUIWorkspace from VBA (Word)

查看:22
本文介绍了无法从 VBA (Word) 实例化 NotesUIWorkspace的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

源情况:我有一个Notes应用程序,它在Windows XP下使用MS Office 2000.新情况必须是Windows 7下的MS Office 2010.IBM Notes是8.5.3FP3.旧的使用 VBA 模板与可以正常工作的 Notes 进行通信.一次创建 Notes.NotesUiWorkSpace 对象以打开文档、导航到富文本项、选择所有内容(已格式化)并复制到剪贴板.然后通过 VBA 将剪贴板内容粘贴到 Word 文档中.这很好用.第二个环境中的相同代码不再起作用.我注意到 Notes.NotesUIWorkSpace 对象不能在 VBA 中实例化.没有错误,没有提示.只有当我稍后引用工作区对象时的运行时错误.

The source situation: I have an Notes Application which uses MS Office 2000 under Windows XP. The new situation has to be MS Office 2010 under Windows 7. IBM Notes is 8.5.3FP3. The old one uses a VBA template to communicate with Notes which works properly. At one time a Notes.NotesUiWorkSpace object is created to open a document, navigate to a richtext item, select all the content (formatted) and copy to the clipboard. Then the clipboard content ist pasted into the Word document via VBA. That works fine. The same code in the second environment doesn't work anymore. I noticed that the Notes.NotesUIWorkSpace object cannot be instanciated in VBA. No errors, no hints. Only the runtime error when I reference the workspace-object later.

这是一段代码摘录:

' this is a profile document which is filled correctly
Call prof.Save(True, True)
Call prof.replaceItemValue("Form", "Profile")
' setting up the ui
dim WS as Object
set WS = CreateObject("Notes.NotesUiWorkSpace")
Set uiprof = WS.EditDocument(True, prof)

' Set uiprof = WS.currentDocument
If uiprof.editMode Then Call uiprof.gotofield("RT")
Call uiprof.SelectAll
Call uiprof.Copy
Call uiprof.Close
' later on the clipboard will be pasted into the word document

任何想法可能是什么原因?我今晚用XP、MS Office 2010和Notes设置环境,检查是否不是Windows 7引起的.

Any ideas what could be the cause here? I am setting up an environment with XP, MS Office 2010 and Notes tonight to check it out that it is not caused by Windows 7.

推荐答案

如果 Windows 7 机器是 64 位的,看看答案 此处.请注意,这些是指 COM 类 (lotus.),并且您使用的是 OLE 类(注释.),但我相信 64/32 位问题适用于两者.

If the Windows 7 machine is 64 bit, take a look at the answers here. Note that those refer to the COM classes (lotus.), and you are using the OLE classes (notes.), but I believe the 64/32 bit issue applies to both.

这篇关于无法从 VBA (Word) 实例化 NotesUIWorkspace的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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