我在perl中遇到以下異常。此外,我現在正在perl技術。 例外是:在Perl中關閉文檔時獲取OLE異常
Win32::OLE<0.1709> error 0x800a1423
in METHOD/PROPERTYGET "Close" at getWordComments.pl line no 350
這裏是getWordComments.pl的樣本代碼,其中異常被正在添加。
A)繼打開然後我讀註釋的文檔
#Open the document in MS Word
use Win32::OLE;
{
no warnings;
use Win32::OLE::Const 'Microsoft.Word'; # wd constants
}
$word=Win32::OLE->new('Word.Application');
$word->{Visible} = 1;
$word->{DisplayAlerts} = 0;
$Document=$word->Documents->Open({Filename => $filename, ReadOnly => 1});
B)代碼。 C)以下代碼用於關閉文檔。
$Document->{Saved}=1;
$Document->Close;
undef $Document;
#Close Word
$word->Quit;
undef $word;
辦公室版本是這個問題嗎? 因爲文檔是用.docx。它適用於.doc。
請幫我解決這個問題。
我正在閱讀文檔的註釋表單並將文檔保存在服務器上。它工作正常的擴展名* .docx和* .doc
文件的其餘部分也可以請你提供我喜歡我如何在perl中做到這一點。
我想關閉2003 office和2007 office版本的文檔。
這是版本問題嗎?
感謝和問候 阿文德Porlekar
我正在閱讀文檔的註釋並將文檔保存在服務器上。它適用於擴展名爲* .docx和* .doc的文檔的其餘部分。 – user1338040 2012-04-17 12:30:58