- - * - WhiteUnicorn - * - -




* #WhiteUnicorn/ StartPage/ Documentation/DelphiFAQ >


Frequently Asked Questions

Automating Word 7

Question:

How do I automate Word 7?

Answer:

You can get to any of the interfaces exposed by the word 
automation server. These can be found by loading MSWORD8.OLB 
into Delphi which will display the type library information. 
You can also use the Application's WordBasic property to get 
at the VB used in Word. The following sample demonstrates both
avenues: 

implementation

uses ComObj;

{$R *.DFM}

var
  V: OleVariant;

procedure TForm1.Button1Click(Sender: TObject);
begin
  V := CreateOleObject('Word.Application');
  V.ShowMe;
  V.WordBasic.FileNew;
  V.WordBasic.Insert('test');
  V.Run('mymac');
  V.WordBasic.FileSave;
end;

end.



* #WhiteUnicorn/ StartPage/ Documentation/DelphiFAQ >



- - * - Anastasija aka WhiteUnicorn - * - - LJLiveJournal
PFPhotoFile