How to open MS Word from Delphi

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 2
Reputation: alikSmehoff is an unknown quantity at this point 
Solved Threads: 0
alikSmehoff alikSmehoff is offline Offline
Newbie Poster

How to open MS Word from Delphi

 
0
  #1
Oct 25th, 2009
Hello,
how can I open MS Word application in my Delphi program?
I think, it is necessary to work with ActiveX or maybe there is any other way or some free software for this purpose?
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 36
Reputation: fayyaz is an unknown quantity at this point 
Solved Threads: 6
fayyaz fayyaz is offline Offline
Light Poster
 
0
  #2
Oct 25th, 2009
Originally Posted by alikSmehoff View Post
Hello,
how can I open MS Word application in my Delphi program?
I think, it is necessary to work with ActiveX or maybe there is any other way or some free software for this purpose?
Hello
This is a simple program that open Word Document in Delphi
Pascal and Delphi Syntax (Toggle Plain Text)
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, Buttons,ComObj, DB, ADODB, OleServer, Word2000, StdCtrls;
  8.  
  9. type
  10. TForm1 = class(TForm)
  11. Button1: TButton;
  12. procedure Button1Click(Sender: TObject);
  13. private
  14. { Private declarations }
  15. public
  16. { Public declarations }
  17. end;
  18.  
  19. var
  20. Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.dfm}
  25.  
  26. procedure TForm1.Button1Click(Sender: TObject);
  27. var
  28. XApp:Variant;
  29. begin
  30. XApp:=CreateOleObject('Word.Application');
  31. XApp.Visible:=true;
  32. XApp.documents.add;
  33. end;
  34.  
  35. end.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: alikSmehoff is an unknown quantity at this point 
Solved Threads: 0
alikSmehoff alikSmehoff is offline Offline
Newbie Poster
 
0
  #3
Oct 25th, 2009
No, it isn't exactly what I want.
I need to open MS Word application IN my Delphi program, on program's form.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: shanza is an unknown quantity at this point 
Solved Threads: 0
shanza shanza is offline Offline
Newbie Poster
 
0
  #4
Oct 28th, 2009
thanks for this information. nice and useful topic.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 40
Reputation: BitFarmer is an unknown quantity at this point 
Solved Threads: 4
BitFarmer BitFarmer is offline Offline
Light Poster
 
0
  #5
Nov 10th, 2009
You can do it by using a TOleContainer component placed on your form, read the help on this componet, you have all you need in there, also you can "mix" word menus with yours if neccesary.
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 1009 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC