⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u_htsy.pas

📁 一套完整的合同管理系统,大家可以下载来看一看
💻 PAS
字号:
unit U_htsy;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, FileCtrl, Buttons, ComCtrls, ExtCtrls, Word2000,
  OleServer;

type
  Tfrm_htsy = class(TForm)
    WordApplication1: TWordApplication;
    WordDocument1: TWordDocument;
    Panel1: TPanel;
    listview1: TListView;
    Panel2: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    FileListBox1: TFileListBox;
    BitBtn3: TBitBtn;  
    procedure FormShow(Sender: TObject);
    procedure listview1DblClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
    path:string;
  end;

var
  frm_htsy: Tfrm_htsy;

implementation

uses U_htgl, U_Public, U_login;

{$R *.dfm}


procedure Tfrm_htsy.FormShow(Sender: TObject);
var
 newitem:Tlistitem;
  i:integer;
begin
listview1.Clear;  
filelistbox1.Directory:=cg_path;
for i:=0 to filelistbox1.Count - 1 do
begin
   newitem:=listview1.Items.Add;
   newitem.Caption:=filelistbox1.Items.Strings[i];
end;
end;

procedure Tfrm_htsy.listview1DblClick(Sender: TObject);
begin
path:=cg_path+'\'+listview1.Selected.Caption;
if Wordpath(path) then
begin
OpenWordFile('True',path,WordApplication1,WordDocument1);
Rz_Gl(czy,formatdatetime('yyyy年mm月dd日 hh:dd:ss',now),'打开Word');
end
else
application.MessageBox('文件不存在,请检查设置','提示',64);
end;

procedure Tfrm_htsy.BitBtn1Click(Sender: TObject);
var
i:integer;
a:string;
begin
if messagebox(self.Handle,'确定通过吗?','提示',mb_yesno+mb_iconquestion)=idyes then
begin
try
   for i:=0 to listview1.Items.Count-1  do
   begin
      if listview1.Items[i].Checked=True then
      begin
      CopyFile(Pchar(cg_path+'\'+listview1.Items[i].Caption),Pchar(sy_path+'\'+ExtractFileName(path+'\'+listview1.Items[i].Caption)),False);
      DeleteFile(Pchar(cg_path+'\'+listview1.Items[i].Caption));
      end;
   end;
application.MessageBox('保存成功','明日科技');
Rz_Gl(czy,formatdatetime('yyyy年mm月dd日 hh:dd:ss',now),'审阅通过');
self.OnShow(sender);
close;
except
application.MessageBox('保存失败','明日科技',64);
end;
end;
end;

procedure Tfrm_htsy.BitBtn2Click(Sender: TObject);
var
i:integer;
begin
if messagebox(self.Handle,'确定需要修改吗?','提示',mb_yesno+mb_iconquestion)=idyes then
begin
try
   for i:=0 to listview1.Items.Count-1  do
   begin
      if listview1.Items[i].Checked=True then
      begin
      CopyFile(Pchar(cg_path+'\'+listview1.Items[i].Caption),Pchar(xg_path+'\'+ExtractFileName(path+'\'+listview1.Items[i].Caption)),False);
      DeleteFile(Pchar(cg_path+'\'+listview1.Items[i].Caption));
      end;
   end;
application.MessageBox('保存成功','明日科技');
Rz_Gl(czy,formatdatetime('yyyy年mm月dd日 hh:dd:ss',now),'审阅修改');
self.OnShow(sender);
except
application.MessageBox('保存失败','明日科技',64);
end;
end;
end;

procedure Tfrm_htsy.BitBtn3Click(Sender: TObject);
begin
close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -