Word.Basic


2005-01-15 05:57:28 PM
delphi27
Hi,
whats wrong and wy is Word starting twice when running this code.
var
Form1: TForm1;
MyWord:Variant;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
MyWord:=CreateOLEObject('Word.Basic');
MyWord.Shell('Winword');
MyWord.FileOpen('c:\allan\1001324B.doc');
end;
end.
A Winword process is started when CreateOleObject but I can not start Word.
If I omit "MyWord.Shell(...) nothing happens.
Please give me the correct code so I can start the Winword process created
when assigning MyWord and open the document.
Dag