易截截图软件、单文件、免安装、纯绿色、仅160KB

用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常用代码汇总

◇[DELPHI]产生鼠标拖动效果
通过MouseMove事件、DragOver事件、EndDrag事件实现,例如在PANEL上的LABEL:
var xpanel,ypanel,xlabel,ylabel:integer;
PANEL的MouseMove事件:xpanel:=x;ypanel:=y;
PANEL的DragOver事件:xpanel:=x;ypanel:=y;
LABEL的MouseMove事件:xlabel:=x;ylabel:=y;
LABEL的EndDrag事件:label ......

Delphi Open Tools API 浅探

savetime2k@yahoo.com  2004.1.28
http://savetime.delphibbs.com
今天开始学习元件编辑器,感觉比属性编辑器简单许多,但还是遇到了一些疑问。如果你能解答文中记录的问题,请告诉我答案,谢谢!
目 录
===============================================================================
⊙ TBaseComponentEdit ......

Delphi中绘制圆角矩形的窗体

制作圆角矩形的窗体:
01.procedure TPortForm.FormCreate(Sender: Tobject);
02.var hr :thandle;
03.begin
04.hr:=createroundrectrgn(0,0,width,height,20,20);
05.setwindowrgn(handle,hr,true);
06.end;
如果不要窗体外框,则使用:
01.procedure TPortForm.FormCreate(Sender: Tobject);
02.var hr :thandl ......

给Delphi控件设一个图标

方法一:
控件类叫做   TABC,文件名叫 abc.pas 那么新建立一个文件叫
abc.rc
里面内容是
TABC Bitmap icon.bmp
icon.bmp 就是图片文件名,不要超过256色,24x24
然后在命令行下执行 brcc32 abc.rc就会生成 abc.res
改名为 abc.dcr
打开你控件的 dpk文件, 加上 {$R ABC.DCR}
重新编译就可以了。
便捷方 ......

用delphi 在Word上面增加一个按钮

新建一个Active Library
2. 新建一个COM Object,在Class Name填一个名字,如Test。
点一下Implemented Interface后面的List按钮。再点一下对话框中的Add Library按钮,
选择“Program Files\Common Files\Designer”目录下的msaddndr.dll文件。
然后在列表中找到msaddndr.dll里面的_IDTExtensibility2接口点 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号