嘿,谁能告诉我如何打开电源点和播放幻灯片
我有以下代码,但它不起作用
$ppAdvanceOnTime = 2
$ppShowTypeKiosk = 3
$ppSlideShowDone = 5
Add-type -AssemblyName office
$Application = New-Object -ComObject powerpoint.application
$application.visible = [Microsoft.Office.Core.MsoTriState]::msoTrue
$path = "C:\Users\asuribha\Desktop\Web.pptx"
$presentation = $application.Presentations.open($path)
$presentation.SlideShowSettings.AdvanceMode = $ppAdvanceOnTime
$presentation.SlideShowSettings.ShowType = $ppShowTypeKiosk
$presentation.SlideShowSettings.StartingSlide = 1
$presentation.SlideShowSettings.EndingSlide = $presentation.Slides.Count
Do
{
$presenatation.SlideShowSettings.Run.View.
if (Err<>0)
{
Exit Do
}
}
until ($presenatation.SlideShowSettings.Run.View.State = $ppSlideShowDone)
$application.quit()
[gc]::collect()
[gc]::WaitForPendingFinalizers()
此代码打开 power point 但不播放幻灯片!我也有这个问题,它有时会自动关闭电源点。这个你能帮我吗