城
城市小猎人
Unregistered / Unconfirmed
GUEST, unregistred user!
var
ItemIndex :OleVariant;
FileName, ConfirmConversions, ReadOnly, AddToRecentFiles,
PasswordDocument, PasswordTemplate, Revert, Encoding, Visible,
WritePasswordDocument, WritePasswordTemplate, Format: OleVariant;
begin
if OpenDialog1.Execute = False then
Exit;
try
Wordapplication1.Connect;
except
MessageDlg('Word may not be installed', mtError, [mbOk], 0);
Abort;
end;
FileName := OpenDialog1.FileName;
ConfirmConversions := False;
ReadOnly := False;
AddToRecentFiles := False;
PasswordDocument := '';
PasswordTemplate := '';
Revert := True;
WritePasswordDocument := '';
WritePasswordTemplate := '';
Format := wdOpenFormatDocument;
Encoding := '';
Visible := False;
WordApplication1.Documents.Open( FileName, ConfirmConversions,
ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate,
Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible);
{Assign WordDocument component}
ItemIndex := 1;
WordDocument1.ConnectTo(WordApplication1.Documents.Item(ItemIndex));(执行到这里的时候出错:集合所要求的成员不存在。)
end;
帮我看看是怎么回事
ItemIndex :OleVariant;
FileName, ConfirmConversions, ReadOnly, AddToRecentFiles,
PasswordDocument, PasswordTemplate, Revert, Encoding, Visible,
WritePasswordDocument, WritePasswordTemplate, Format: OleVariant;
begin
if OpenDialog1.Execute = False then
Exit;
try
Wordapplication1.Connect;
except
MessageDlg('Word may not be installed', mtError, [mbOk], 0);
Abort;
end;
FileName := OpenDialog1.FileName;
ConfirmConversions := False;
ReadOnly := False;
AddToRecentFiles := False;
PasswordDocument := '';
PasswordTemplate := '';
Revert := True;
WritePasswordDocument := '';
WritePasswordTemplate := '';
Format := wdOpenFormatDocument;
Encoding := '';
Visible := False;
WordApplication1.Documents.Open( FileName, ConfirmConversions,
ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate,
Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible);
{Assign WordDocument component}
ItemIndex := 1;
WordDocument1.ConnectTo(WordApplication1.Documents.Item(ItemIndex));(执行到这里的时候出错:集合所要求的成员不存在。)
end;
帮我看看是怎么回事