使用tcl twapi得到 "无法获取coclass的ITypeInfo:对象不支持IProvideClassInfo和clsid未指定。"错误( office365)

问题描述 投票:0回答:1

我使用tcl8.5和twapi 4.2a1通过组件对象模块来控制outlook,具体代码如下所示

此代码可以使用在office 2016 outlook,但在office365 outlook我得到了错误" "。Could not get ITypeInfo for coclass: object does not support IProvideClassInfo and clsid not specified"在"set biid [$::items -bind eventhandler]"

谁能给我一个解决这个问题的方法?

还是我遗漏了什么?

package require twapi_com

proc eventhandler {args} {
    global ns
    set event  [lindex $args 0]
    set handle [lindex $args 1]
    puts $event
    puts $handle
    set s ""
    set sdr2 ""
    #return $s
}

set outlook [::twapi::objcom Outlook.Application -active]
set ns [$outlook GetNamespace "MAPI"]
set contacts [$ns GetDefaultFolder 6]
set ::items [$contacts Items]
set biid [$::items -bind eventhandler]
outlook com office365 tcl
1个回答
0
投票

看来你的windows注册表键被破坏了。我建议修复你的Office安装。

此外,您可以尝试从其他编程语言中自动Outlook,以确保该问题与TCL无关。

请看 HRESULT:0x80040154 COM 对象的 CLSID {}无效或未注册。 关于这个问题的更多信息。

© www.soinside.com 2019 - 2024. All rights reserved.