代码之家  ›  专栏  ›  技术社区  ›  Shawn de Wet

加载dll时出现Lotus Notes API错误

  •  0
  • Shawn de Wet  · 技术社区  · 14 年前

    我的客户机正在使用Lotus Notes 8.0.2。 我正在尝试使用以下vbscript调用Notes API发送电子邮件:

    dim objNotesSession, objNotesDatabase, objNotesItem, objNotesRichTextItem
    
    set objNotesSession = CreateObject("Lotus.NotesSession")
    Call objNotesSession.Initialize("[password here]")
    set objNotesDatabase = objNotesSession.GETDATABASE("[server here]", "[path to NSF here]")
    set objNotesDocument = objNotesDatabase.CreateDocument
    set objNotesItem = objNotesDocument.ReplaceItemValue("Form", "Memo")
    set objNotesItem = objNotesDocument.ReplaceItemValue("Subject", "My Test Subject")
    set objNotesRichTextItem = objNotesDocument.CreateRichTextItem("Body")
    objNotesRichTextItem.AppendText "This is the body"
    objNotesRichTextItem.EmbedObject 1454, "", "[path to attachment here]"
    objNotesDocument.Send False, "[to address here]"
    
    [cleanup code here]
    

    在线调用objnotessessession.initialize时,我得到以下错误:“加载dll时出错:initialize”

    如果我注释掉该行,执行“set objnotesdatabase=objnotesession.getdatabase”行,则会得到错误“加载dll:getdatabase时出错”

    有人能告诉我为什么会发生这种情况吗?我能做些什么来解决它?

    谢谢, 肖恩。

    2 回复  |  直到 14 年前
        1
  •  1
  •   Ken Pespisa    14 年前

    初始化方法是您登录并真正开始Notes会话的地方。因此,如果您对这行进行注释,那么您实际上并没有连接到Notes,因此无法获得数据库的句柄。

    所以回到初始化部分…我首先要确保您的Notes客户机安装工作正常。您应该能够打开注释、登录和访问要使用的数据库。确保Notes目录和数据目录位于PATH环境变量中。确保您有足够的权限访问Notes目录(可能授予每个人完全访问权限以排除问题)。

    最坏的情况是,尝试重新安装Notes或在另一台Notes工作正常的计算机上运行脚本。

        2
  •  0
  •   Shawn de Wet    14 年前

    是的,结果是有一个Notes补丁应用于开发环境(所有的都在工作),而不是应用于活动环境。