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

将Word嵌入Delphi中

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://bigpower.blog.51cto.com/209892/90287
unit Main;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls,Comobj;
type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Label1: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    procedure Panel1Resize(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    FComApp:OleVariant;
    gWaveHwnd:Hwnd;
  public
    { Public declarations }
    procedure SetParentWindow(pParent: TWinControl);
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
  Word : Variant;
begin
  FComApp := CreateOLEObject('Word.Application');
  FComApp.Documents.Open(extractfilepath(Application.ExeName)+'\test.doc',false);
  FComApp.Visible := True;
  Label1.Caption := FComApp.ActiveWindow.Caption;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
  SetParentWindow(Panel1);
end;
procedure TForm1.Panel1Resize(Sender: TObject);
begin
  if gWaveHwnd<>0 then
  begin
    FComApp.ActiveWindow.Height := Panel1.Height;
    FComApp.ActiveWindow.Width := Panel1.Width;
    Windows.MoveWindow(gWaveHwnd,0,0,Panel1.Width,Panel1.Height,false);
  end;
end;
procedure TForm1.SetParentWindow(pParent: TWinControl);
var
  lWaveHwnd : Hwnd;
  lWidth, lHeight: Integer;
  lWindowCap


相关文档:

Delphi图像处理

前言
    尽三年来,本人陆续写了六十多篇BOLO文章,其中绝大部分是有关图像处理的,因此,有人戏称我为图像处理专家(或GDI+专家),此戏称当然是对我的赞扬,但我自己却觉得略含一丝丝贬义,即除了图像处理,别的方面(如网络、数据库等)都不咋的,事实也确实如此。
    我是一名机关工 ......

Delphi 完全时尚手册之 Visual Style 篇

    这里先说说两个概念:Theme(主题)和 Visual Style 。Theme 最早出现在 Microsoft Plus! for Windows 95 中,是 Windows 中 Wallpaper、Cursors、Fonts、Sounds 、Icons 等的设置值集合。Visual Style 在 Windows XP 中才被引入,Visual Style 规定了 Contorls 的外观,另外还包括使用这些外观的一套 API ......

知识小结(Delphi)

1) Error loading midas.dll     没有注册midas.dll 运行RegSver32.exe midas.dll
2)Result := GetProcAddress(FGDIPlusLibrary, PChar(ProcName));编译 出现这样的问题,应该是设置方面的问题,Project->Options->Complier->Hugestrings 钩上就ok了!
3) TCheckListBox有个itemEnable ......

用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' ......

总结一下delphi中SQL语句中引号

总结一下SQL语句中引号(')、quotedstr()、('')、format()在SQL语句中的用法以及SQL语句中日期格式的表示(#)、('')
在Delphi中进行字符变量连接相加时单引号用('''),又引号用('''')表示
首先定义变量
var
AnInt:integer=123;//为了方便在此都给它们赋初值。虽然可能在引赋初值在某些情况下不对
AnIntStr:string='456'; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号