用delphi吧一个word文档追加到另外一个word文档中
uses ComObj;
var WordApp: Variant;
begin
WordApp := CreateOleObject('Word.Application');
WordApp.Documents.open('c:\1.doc');
WordApp.Selection.InsertFile('c:\2.doc','',False,false,false);
WordApp.Selection.InsertFile('c:\3.doc','',False,false,false);
WordApp.ActiveDocument.SaveAs('C:\4.doc');//,'wdFormatDocument',False,'',True,'',False,False,False,False,False);
WordApp.Quit;
OleContainer1.CreateObjectfromFile('c:\4.doc',true);
procedure TFrm_Main.btUniteClick(Sender: TObject);
var
I: Integer ;
DocFileName: String ;
DocFile:OleVariant ;
begin
if lvFileName.Items.Count <1 then
Exit ;
btUnite.Enabled := False ;
try
pnJC.Visible := True ;
Frm_Main.Update ;
try
WordA.Connect ;
WordA.Visible := True;
WordDocument1.ConnectTo(WordA.Documents.Add(EmptyParam,EmptyParam,EmptyParam,EmptyParam) );
MixWordWindow('Word 文档合并器');
for I := 0 to lvFileName.Items.Count -1 do
begin
ProgressBar1.Position := I * 100 div lvFileName.Items.Count ;
Label3.Caption := lvFileName.Items.Item[I].SubItems.Strings[0] ;
Frm_Main.Update ;
DocFileName := lvFileName.Items.Item[I].SubItems.Strings[0] ;
WordA.Selection.InsertFile(DocFileName,EmptyParam,EmptyParam,EmptyParam,EmptyParam) ;
end;
ProgressBar1.Position := 100 ;
if CheckBox1.Checked then
begin
DocFile := edDocFileName.Text ;
WordDocument1.SaveAs(DocFile);
end ;
if CheckBox2.Checked then lvFileName.Items.Clear ;
if (CheckBox3.Checked) and (CheckBox1.Checked) then WordA.Quit ;
WordA.Disconnect ;
if CheckBox1.Checked then
Application.MessageBox(PChar('文档合并工作已经成功的完成。保存在' + #13+ edDocFileName.Text ),'完成', MB_OK or MB_ICONINFORMATION)
else
Application.MessageBox(PChar('文档合并工作已经成功的完成。请及时保存该文档!' ),'完成', MB_OK or MB_ICONINFORMATION) ;
if CheckBox1.Checked then
begin
DocCount := DocCount + 1 ;
edDocFileName.Text := ExtractFilePath(edDocFileName.Text) + '合并文档'+ IntToStr(DocCount) +'.Doc' ;
end;
except
on E: Exception do
begin
Application.Mess
相关文档:
在DELPHI为编程者提供了一个灵活的绘图场所,即本文所述的
CANVAS类,在DELPHI中的很多控件都具有此属性,使编程者可以
在这些的控件的表面随心所欲的绘图,这对完善用户界面或者制
作一些屏幕特技都有着非凡的作用,下面举例说明几种特殊屏幕
......
图像缩放是最常用的图像处理,在图像拉伸和取得图像略图中都要用到。图像缩放质量的好坏与图像像素插值方式有关,本文定义了常用的3种插值方式,即临近插值、线性插值和双立方插值方式:
type
// 插值方式: 缺省(线性插值),临近,线性,双立方
TInterpolateMode = (imDefault, imNear, imBiline ......
delphi获取Windows系统的进程运行信息
自从出现windows系统以来,各种各样的软件层出不穷。购买或者免费下载以后,轻轻点击Install或者Setup以后,稍作些许简单配置就完成安装的整个过程。显然这给用户带来了许多方便,但对用户来说这些软件似乎是个"黑匣子",展现在用户面前的仅仅是华丽的外表和简洁的操作,至于软 ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, ExtCtrls,MSHTML;
type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Edit1: TEdit;
&nb ......