问题描述
源情况:我有一个Notes应用程序,该应用程序在Windows XP下使用MS Office 2000.新情况必须是Windows 7下的MS Office2010.IBMNotes是8.5.3FP3.旧版本使用VBA模板与Notes进行通信,该模板可以正常工作.一次创建一个Notes.NotesUiWorkSpace对象以打开一个文档,导航到一个RTF项,选择所有内容(已格式化)并复制到剪贴板.然后剪贴板内容通过VBA粘贴到Word文档中.很好第二个环境中的相同代码不再起作用.我注意到在VBA中无法实例化Notes.NotesUIWorkSpace对象.没有错误,没有提示.稍后我引用工作空间对象时,只会出现运行时错误.
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实例化NotesUIWorkspace(Word)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!