我想要打開並閱讀PowerPoint演示文稿的幻燈片中的文本。 我該怎麼做? 我知道我可能不得不使用Win32:OLE
,但到目前爲止,我試過的所有代碼示例都不起作用。Perl - 打開並閱讀.ppt/.pptx文件?
編輯: 我只有這部分代碼不工作:
$file = "C:\file.pptx";
my $powerpoint = Win32::OLE->GetActiveObject('Powerpoint.Application');
my $document = $powerpoint->Presentations->Open($file);
my $slides = Win32::OLE::Enum->new($document->Slides);
print $slides;
謝謝!
您能告訴我們您嘗試過什麼嗎? – Schwern
是的,我編輯了我的帖子 – gambit20088
你試圖運行這個代碼的平臺是什麼?示例中的代碼僅適用於安裝了PowerPoint的Windows系統。 – duskwuff