用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
相关文档:
一个很简单的问题,但我凭我学习C++/VC一年多,接触Delphi的时间也不短了,但仍然写不出来。
本来以为,不就是将Form1.Show和Form1.Hide么,但却就是达到不到自己想要的结果
这个问题倒不用作深入研究了,到是让我发现,Delphi也不是信手摘来,什么都是那么容易的,以为自己有点儿VC的底子,就小看了Delphi。
最近一段时 ......
在DELPHI为编程者提供了一个灵活的绘图场所,即本文所述的
CANVAS类,在DELPHI中的很多控件都具有此属性,使编程者可以
在这些的控件的表面随心所欲的绘图,这对完善用户界面或者制
作一些屏幕特技都有着非凡的作用,下面举例说明几种特殊屏幕
......
这里先说说两个概念:Theme(主题)和 Visual Style 。Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpaper、Cursors、Fonts、Sounds 、Icons 等的设置值集合。Visual Style 在 Windows XP 中才被引入,Visual Style 规定了 Contorls 的外观,另外还包括使用这些外观的一套 API ......
delphi获取Windows系统的进程运行信息
自从出现windows系统以来,各种各样的软件层出不穷。购买或者免费下载以后,轻轻点击Install或者Setup以后,稍作些许简单配置就完成安装的整个过程。显然这给用户带来了许多方便,但对用户来说这些软件似乎是个"黑匣子",展现在用户面前的仅仅是华丽的外表和简洁的操作,至于软 ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw;
t ......