P
pluto_jelly
Unregistered / Unconfirmed
GUEST, unregistred user!
错误如下:(由于是对远程机器中文档的调用,请帮忙)
对该文件有权限错误,试用如下建议:
*查看对该文件的权限
*用“文件”中的“打开”来定位该文件
代码如下:
var
ItemIndex:OleVariant;
Filename,ConfirmConversions,ReadOnly,AddRecentFiles,
PasswordDocuments,PasswordTemplate,Revert,
WritePasswordDocument,WritePasswordTemplate,Format:Olevariant;
begin
try
WordApplication1.Connect;
WordApplication1.Visible := true;
WordApplication1.Caption := 'aaaaa';
except
end;
Filename := '//REMOTEHOST/DIRECTORY/FILENAME.doc';
ConfirmConversions := false;
Readonly := False;
AddRecentFiles := False;
PassWordDocuments := '';
PassWordTemplate := '';
Revert := True;
WritePassWordDocument := '';
WritePassWordTemplate := '';
Format := wdOpenFormatDocument;
ItemIndex :=1;
WordDocument1.ConnectTo(WordApplication1.Documents.Open(Filename,ConfirmConversions,ReadOnly,AddRecentFiles,PasswordDocuments,PasswordTemplate,Revert,WritePasswordDocument,WritePasswordTemplate,Format) as _Document);
WordApplication1.Options.CheckSpellingAsYouType := False;
WordApplication1.Options.CheckGrammarAsYouType := False;
对该文件有权限错误,试用如下建议:
*查看对该文件的权限
*用“文件”中的“打开”来定位该文件
代码如下:
var
ItemIndex:OleVariant;
Filename,ConfirmConversions,ReadOnly,AddRecentFiles,
PasswordDocuments,PasswordTemplate,Revert,
WritePasswordDocument,WritePasswordTemplate,Format:Olevariant;
begin
try
WordApplication1.Connect;
WordApplication1.Visible := true;
WordApplication1.Caption := 'aaaaa';
except
end;
Filename := '//REMOTEHOST/DIRECTORY/FILENAME.doc';
ConfirmConversions := false;
Readonly := False;
AddRecentFiles := False;
PassWordDocuments := '';
PassWordTemplate := '';
Revert := True;
WritePassWordDocument := '';
WritePassWordTemplate := '';
Format := wdOpenFormatDocument;
ItemIndex :=1;
WordDocument1.ConnectTo(WordApplication1.Documents.Open(Filename,ConfirmConversions,ReadOnly,AddRecentFiles,PasswordDocuments,PasswordTemplate,Revert,WritePasswordDocument,WritePasswordTemplate,Format) as _Document);
WordApplication1.Options.CheckSpellingAsYouType := False;
WordApplication1.Options.CheckGrammarAsYouType := False;