C
ccad
Unregistered / Unconfirmed
GUEST, unregistred user!
在windows2000,office2000,delphi6.0环境下,为什么WordApplication1.Documents.Open
通不过,delphi提示Not enough actual paramenters.
procedure TForm1.Button2Click(Sender: TObject);
var
ItemIndex: OleVariant;
FileName, ConfirmConversions, ReadOnly, AddToRecentFiles,
PasswordDocument, PasswordTemplate, Revert,
WritePasswordDocument, WritePasswordTemplate, Format: OleVariant;
begin
//if not Opendialog1.Execute then Exit;
{Open document}
//FileName := Opendialog1.FileName;
FileName := 'c:/qqq.doc';
ConfirmConversions := False;
ReadOnly := False;
AddToRecentFiles := False;
PasswordDocument := '';
PasswordTemplate := '';
Revert := True;
WritePasswordDocument := '';
WritePasswordTemplate := '';
Format := wdOpenFormatDocument;
WordApplication1.Documents.Open(FileName, ConfirmConversions, ReadOnly,
AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert,WritePasswordDocument,
WritePasswordTemplate, Format);
{Assign WordDocument component}
ItemIndex := 1;
WordDocument1.ConnectTo(WordApplication1.Documents.Item(ItemIndex));
{Turn Spell checking off because it takes a long time if enabled and slows down Winword}
WordApplication1.Options.CheckSpellingAsYouType := False;
WordApplication1.Options.CheckGrammarAsYouType := False;
end;
通不过,delphi提示Not enough actual paramenters.
procedure TForm1.Button2Click(Sender: TObject);
var
ItemIndex: OleVariant;
FileName, ConfirmConversions, ReadOnly, AddToRecentFiles,
PasswordDocument, PasswordTemplate, Revert,
WritePasswordDocument, WritePasswordTemplate, Format: OleVariant;
begin
//if not Opendialog1.Execute then Exit;
{Open document}
//FileName := Opendialog1.FileName;
FileName := 'c:/qqq.doc';
ConfirmConversions := False;
ReadOnly := False;
AddToRecentFiles := False;
PasswordDocument := '';
PasswordTemplate := '';
Revert := True;
WritePasswordDocument := '';
WritePasswordTemplate := '';
Format := wdOpenFormatDocument;
WordApplication1.Documents.Open(FileName, ConfirmConversions, ReadOnly,
AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert,WritePasswordDocument,
WritePasswordTemplate, Format);
{Assign WordDocument component}
ItemIndex := 1;
WordDocument1.ConnectTo(WordApplication1.Documents.Item(ItemIndex));
{Turn Spell checking off because it takes a long time if enabled and slows down Winword}
WordApplication1.Options.CheckSpellingAsYouType := False;
WordApplication1.Options.CheckGrammarAsYouType := False;
end;