Powershell脚本:无法找到Microsoft.office.interlop.Wdsaveformat

问题描述

@H_502_0@我有一个用于更改Outlook中签名的脚本。该脚本在 32位上运行fin,但在64位上出现了Microsoft.Interlop,word,WdSaveFormat错误。我已经添加了 : $wdTypes = Add-Type -AssemblyName 'Microsoft.Office.Interop.Word' -Passthru $wdSaveFormat = $wdTypes | Where {$_.Name -eq "wdSaveFormat"}

@H_502_0@但是我现在收到此错误

@H_502_0@ Microsoft.Office.Interlop.Word版本= 12.0.0.0文化=中性或其依赖项之一。系统找不到指定的文件

@H_502_0@这是我的集团代码

$wdTypes = Add-Type -AssemblyName 'Microsoft.Office.Interop.Word' -Passthru
$wdSaveFormat = $wdTypes | Where {$_.Name -eq "wdSaveFormat"}
$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat],"wdFormatHTML"); 
$path = $LocalSignaturePath + '\' + $SignatureName + ".htm" 
$MSWord.ActiveDocument.saveas([ref]$path,[ref]$saveFormat) 
@H_502_0@可以帮忙吗?

@H_502_0@问题发生在Outlook 2016 64位上,并且在Office 2016 32位上运行良好

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)