如何用delphi控制ole容器里的word???? 如何用delphi控制ole容器里的word???? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit Unit1;interfaceusesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,StdCtrls,OleCtnrs,ComObj;typeTForm1 = class(TForm)Label1: TLabel;Label2: TLabel;Label3: TLabel;Label4: TLabel;Label5: TLabel;ED_WenHao: TEdit;ED_BiaoTi: TEdit;ED_ShouWenDanWei: TEdit;ED_ZhenWen: TMemo;ED_FaWenDanWei: TEdit;Btn_PrintToWord: TButton;Btn_Quit: TButton;procedure Btn_PrintToWordClick(Sender: TObject);procedure Btn_QuitClick(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.DFM}//开始:数据发送到 word事件procedure TForm1.Btn_PrintToWordClick(Sender: TObject);vARVarWord: Variant;// 创建 WORD时所用begintry// 1. 建立 OleObject,连接 word97VarWord:=CreateOleObject('word.basic');// 2. 建立 Word97的新文件VarWord.FileNew;// 3. 设置 Word97的基本状态VarWord.ViewZoom75; //设置显示比例为 75%VarWord.ViewPage; //改为页面显示方式// 4. 将当前数据控件上的信息发送至 Word97// 4.1 发送文号数据VarWord.CenterPara; //居中Varword.font('宋体 '); //设置字体VarWord.FontSize(14); //设置字号varword.insert(#13+#13+ ED_WenHao.Text+#13+#13+#13);// 4.2 发送标题数据VarWord.font('黑体 ');VarWord.Fontsize(16);VarWord.insert( ED_BiaoTi.text+#13);// 4.3 发送收文单位数据VarWord.LeftPara; //左对齐VarWord.Font('宋体 ');VarWord.fontSize(14);VarWord.Insert(#13+ ED_ShouWenDanWei.Text+': '+#13);// 4.5 发送正文数据VarWord.fontSize(14);VarWord.Insert( ED_ZhenWen.Text+#13);// 4.6 发送发文单位数据VarWord.RightPara; //右对齐VarWord.fontSize(14);VarWord.Insert( ED_FaWenDanWei.Text+#13);// 5 最后设置VarWord.StartOfdocument; //到文首VarWord.AppMaxiMize; //设置窗口最大化VarWord.AppShow; //显示应用程序exceptshowmessage('运行 Microsoft Word 失败! ');end; //end of tryend;//end:数据发送到 word事件 //开始:窗口关闭事件procedure TForm1.Btn_QuitClick(Sender: TObject);beginclose;end;//End:窗口关闭事件end. 请教Delphi调用C 动态库问题 我使用shellexecute或shellexecuteex打开文档(不是Exe),如何才能获取打开的文件顶级窗口句柄?或根据返回进程ID获得句柄? 网卡信息问题 如何将DateTimePicker的日期拆分开年,月,日,分别显示在三个LABEL上 真的很急,渴望尽快答复,多谢了!!!!! 求delphi6.0网络及数据库时尚编程百例 附书光盘资料 △△△△急!急!急!HTML 帮助文件在Delphi中的调用问题???△△△△ 能用什么东西连接SMTP? 请看这个sql?????? delphi初学者用什么好书,能介绍好书给我吗???? 小弟的软件 发布 散点分~~~~~~~~~~ 怎么样删除.ocx的控件?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货