我在 perl 中遇到了以下异常。我现在也使用 perl 技术。例外是:
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;
是office版本的问题吗?因为文档是 .docx。它适用于.doc。
请帮我解决这个问题。
我正在阅读文档的评论并将文档保存在服务器上。它适用于扩展名为 *.docx 和 *.doc 的文档的其余部分
你也可以请我告诉我如何在 perl 中做到这一点。
我想关闭 2003 office 和 2007 office 版本的文档。
这是版本问题吗?
感谢和问候 Arvind Porlekar