我使用tcl8.5和twapi 4.2a1通过组件对象模块控制outlook,如下所示
此代码可以在office 2016 outlook中使用,但在office365 outlook中,我在"set biid [$::items -bind eventhandler]“中遇到错误"Could not get ITypeInfo for coclass: object does not support IProvideClassInfo and clsid not specified”。
有人能给我一个解决这个问题的主意吗?
还是我错过了什么?
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]发布于 2020-06-02 20:02:34
您的windows注册表项似乎已损坏。我建议修复您的Office安装。
此外,您可以尝试从另一种编程语言自动化Outlook,以确保该问题与TCL无关。
有关此问题的详细信息,请参阅HRESULT:0x80040154 COM object with CLSID {} is either not valid or not registered。
https://stackoverflow.com/questions/62144067
复制相似问题