看到powershell有一个奇怪的问题,代码如下:
[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.PowerPoint")
$ppt = New-Object Microsoft.Office.Interop.PowerPoint.ApplicationClass
Register-ObjectEvent -InputObject $ppt -EventName "PresentationBeforeSave" -SourceIdentifier "LBPPTBeforeSave" -Action { Write-Host "here" }
我迷上PresentationBeforeSave
了 PowerPoint。这很好,但是当我在 Powerpoint 中点击保存时,ISE 完全崩溃了。在事件查看器中,我看到了不好的东西、退出代码80131506
和0xc0000005
.
SlideSelectionChanged
不过,我可以很好地钩住。所以我想知道这是否与暴露的Cancel
out 变量有关?PresentationBeforeSave
任何意见,将不胜感激。