ÓÃ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
Ïà¹ØÎĵµ£º
³£ÓÿؼþÃüÃûǰ׺
¿Ø¼þÀàÃû
ǰ׺
TFormµÈ´°ÌåÀà
frm
TButton, TSpeedButtonµÈËùÓеİ´Å¥Àà
btn
TCheckBoxµÈËùÓеļì²é¿ò
chk
TRadioButtonµ¥Ñ¡°´Å¥Àà
rdo
TListBoxµÈËùÓеÄÁбí¿òÀà
lst
TPanelµÈËùÓеÄÃæ°åÀà
pnl
TLabel, TStaticTextµÈËùÓÐÓÃÀ´ÏÔʾµÄ±êÇ©Àà
lbl
TE ......
......
Ò»¡¢KOLÊÇʲô?KOLÄÜ×öʲô? MCKÊÇʲô?MCKÄÜ×öʲô?
KOLÊÇÒ»Ì×¶ÔÏó¿â£¬Ãâ·Ñ¶øÇÒ¿ª·ÅÔ´´úÂ룬´ó¼Ò¿ÉÒÔhttp://www.kolmck.net/È¥ÏÂÔØµ½
Ëü¡£ËüÄܹ»Ê¹Delphi±à³ö³ß´ç·Ç³£Ð¡µÄ32λWindowsͼÐÎÓû§½çÃæµÄÓ¦ÓóÌÐò¡£
Ŀǰ֧³ÖµÄDelphi°æ:Delphi6,Delphi5,Delphi4,Delphi3ºÍDelphi2¡£
ʹÓÃKOLÔÚD2-D5ÖбàдµÄ×îСͼÐνçÃæ³ÌÐò ......
ÕâÀïÏÈ˵˵Á½¸ö¸ÅÄTheme(Ö÷Ìâ)ºÍ Visual Style ¡£Theme ×îÔç³öÏÖÔÚ Microsoft Plus! for Windows 95 ÖУ¬ÊÇ Windows ÖÐ Wallpaper¡¢Cursors¡¢Fonts¡¢Sounds ¡¢Icons µÈµÄÉèÖÃÖµ¼¯ºÏ¡£Visual Style ÔÚ Windows XP Öвű»ÒýÈ룬Visual Style ¹æ¶¨ÁË Contorls µÄÍâ¹Û£¬ÁíÍ⻹°üÀ¨Ê¹ÓÃÕâЩÍâ¹ÛµÄÒ»Ì× API ......
1.1¡¢¼¤»î
var doc,url:Olevariant ;
begin
url:='about:blank' ;//»òÕßÒ»¸öÓÐʵ¼ÊÒâÒåµÄurl
WebBrowser1.Navigate2(url);//ÕâÑù¾Í¼¤»îÁË£¡
end;
1.2¡¢Ð´HTML´úÂë
var doc:Olevariant ;
s:string;
begin
doc:=WebBrowser1.Document;
doc.clear;//Çå³þÔµÓÉÄÚÈÝ£¬ÒÔ±ãдÐÂÄÚÈÝ
doc.write('<html>');
//ÆäË ......