2013-07-19 14 views
0

當我試圖頂開的PPT,而不是創建一個新的(工作正常!),我收到以下錯誤AutoIt的COM錯誤打開一個PPT/PPTX

$objPPT = _PPT_PowerPointApp() 
If @error Then 
    MsgBox(0,"","No PowerPoint available") 
    Exit 
EndIf 
$PresInterface = _PPT_CreatePresentation($objPPT) ;Get presentation 
interface$objPres = _PPT_PresentationOpen($PresInterface,"C:\Users\s.mailappan\Desktop\3G-Reports\MyAutoItPresentation.ppt") ;Add a new presentation 

COM Error while opening a PPT/PPTX

+1

最後兩行可能是亂碼?不應該有「接口」直接的變量'$ objPres' ... – Samoth

+0

是的......之前我得到了工作!不管怎麼說,還是要謝謝你!! – Siva

回答

0

要打開現有的PPT,需要從我的原始代碼中刪除以下行。

$PresInterface = _PPT_CreatePresentation($objPPT) ;Get presentation 

這使得下面的代碼工作。

$objPPT = _PPT_PowerPointApp() 
If @error Then 
    MsgBox(0,"","No PowerPoint available") 
    Exit 
EndIf 

$objPres = _PPT_PresentationOpen($objPPT,"C:\Users\s.mailappan\Desktop\3G-Reports\MyAutoItPresentation.ppt") ;Add a new presentation