📄 wendang.pas
字号:
LianJie:=Yue+Ri;
LianJie:=LianJie+'\'+IntToStr(DBText1.Field.Value);
ZhuangH:=IntToStr(DBText2.Field.Value);
//判断位置
if DBText4.Field.Value='图书馆' then
OpenName:=ComboBox3.Text+'\'+LianJie+'\图'+ZhuangH+'.doc'
else if DBText4.Field.Value='档案馆' then
OpenName:=ComboBox3.Text+'\'+LianJie+'\档'+ZhuangH+'.doc'
else
OpenName:=ComboBox3.Text+'\'+LianJie+'\地'+ZhuangH+'.doc';
//打开文件
if FileExists(OpenName) then
begin
wordapplication1.Visible:=true;
WordApplication1.Documents.Open(OpenName,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam)
end
else
ShowMessage(OpenName+'不存在');
end;
//---------------------------------------------------------
procedure TWenDangForm.Button8Click(Sender: TObject);
var Yue,Ri,DToS,LianJie: string;
begin
//定位目录
DToS:=DateToStr(DBText3.field.Value);
Yue:=Copy(DToS,6,2);
Ri:=Copy(DTos,9,2);
LianJie:=Yue+Ri;
//MuLuName:='';
if DBText4.Field.Value='图书馆' then
MuLuName:=ComboBox4.Text+'\'+LianJie+'\t.jpg'
else if DBText4.Field.Value='档案馆' then
MuLuName:=ComboBox4.Text+'\'+LianJie+'\da.jpg'
else
MuLuName:=ComboBox4.Text+'\'+LianJie+'\d.jpg';
//open file
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
//-----------------------------------------------------------
procedure TWenDangForm.Button10Click(Sender: TObject);
begin
OpenDialog1.InitialDir:=ComboBox4.Text;
if OpenDialog1.Execute then
end;
//----------------------------------------------------------
procedure TWenDangForm.Button11Click(Sender: TObject);
var Yue,Ri,DToS,LianJie: string;
begin
//定位目录
DToS:=DateToStr(DBText3.field.Value);
Yue:=Copy(DToS,6,2);
Ri:=Copy(DTos,9,2);
LianJie:=Yue+Ri;
if DBText4.Field.Value='图书馆' then
MuLuName:=ComboBox5.Text+'\'+LianJie+'\t.jpg'
else if DBText4.Field.Value='档案馆' then
MuLuName:=ComboBox5.Text+'\'+LianJie+'\da.jpg'
else
MuLuName:=ComboBox5.Text+'\'+LianJie+'\d.jpg';
//open file
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
//-----------------------------------------------------------
procedure TWenDangForm.DBNavigator1Click(Sender: TObject;
Button: TNavigateBtn);
begin
if DBText4.Field.Value='地下室' then
begin
RB12.Enabled:=true;
RB18.Enabled:=true;
RB14.Enabled:=false;
RB20.Enabled:=false;
RB25.Enabled:=false;
RBh18.Enabled:=true;
RBh20.Enabled:=false;
RBh25.Enabled:=false
end
else
begin
RB12.Enabled:=false;
RB18.Enabled:=false;
RB14.Enabled:=true;
RB20.Enabled:=true;
RBh18.Enabled:=false;
RBh20.Enabled:=true;
if data1.XiuGaiT.FieldByName('MaoZhuang').Asvariant then
begin
RB25.Enabled:=true;
RBh25.Enabled:=true
end
else
begin
RB25.Enabled:=false;
RBh25.Enabled:=false;
end
end;
if data1.XiuGaiT.FieldByName('JingZaiJianCe').AsVariant='' then
// TabSheet14.Enabled:=false
PageControl1.Controls[9].Visible:=false
else
TabSheet14.Enabled:=true;
if data1.XiuGaiT.FieldByName('XiaoYingBianJianCe').AsVariant='' then
TabSheet15.Enabled:=false
else
TabSheet15.Enabled:=true;
end;
//-------------------------------------------------------------
procedure TWenDangForm.FormActivate(Sender: TObject);
begin
if DBText4.Field.Value='地下室' then
begin
RB12.Enabled:=true;
RB18.Enabled:=true;
RB14.Enabled:=false;
RB20.Enabled:=false;
RBh18.Enabled:=true;
RB25.Enabled:=false;
RBh20.Enabled:=false;
RBh25.Enabled:=false
end
else
begin
RB12.Enabled:=false;
RB18.Enabled:=false;
RB14.Enabled:=true;
RB20.Enabled:=true;
RBh18.Enabled:=false;
RBh20.Enabled:=true;
if data1.XiuGaiT.FieldByName('MaoZhuang').Asvariant then
begin
RB25.Enabled:=true;
RBh25.Enabled:=true
end
else
begin
RB25.Enabled:=false;
RBh25.Enabled:=false;
end
end;
if data1.XiuGaiT.FieldByName('JingZaiJianCe').AsVariant='' then
//TabSheet14.Enabled:=false
PageControl1.Controls[9].Visible:=false
else
TabSheet14.Enabled:=true;
if data1.XiuGaiT.FieldByName('XiaoYingBianJianCe').AsVariant='' then
TabSheet15.Enabled:=false
else
TabSheet15.Enabled:=true;
end;
//-----------------------------------------------------------
procedure TWenDangForm.Button14Click(Sender: TObject);
var Yue,Ri,DToS,LianJie: string;
begin
DToS:=DateToStr(DBText3.field.Value);
Yue:=Copy(DToS,6,2);
Ri:=Copy(DTos,9,2);
LianJie:=Yue+Ri;
case PageControl2.ActivePageIndex of
0:begin
if rb8.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\8.jpg';
if rb12.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\12.jpg';
if rb14.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\14.jpg';
if rb18.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\18.jpg';
if rb20.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\20.jpg';
if rb25.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\25.jpg';
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
1:begin
if rb8.Checked=true then
MuLuName:=ComboBox7.Text+'\'+LianJie+'\8.jpg';
if rb12.Checked=true then
MuLuName:=ComboBox7.Text+'\'+LianJie+'\12.jpg';
if rb14.Checked=true then
MuLuName:=ComboBox7.Text+'\'+LianJie+'\14.jpg';
if rb18.Checked=true then
MuLuName:=ComboBox7.Text+'\'+LianJie+'\18.jpg';
if rb20.Checked=true then
MuLuName:=ComboBox7.Text+'\'+LianJie+'\20.jpg';
if rb25.Checked=true then
MuLuName:=ComboBox6.Text+'\'+LianJie+'\25.jpg';
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
end;
end;
//------------------------------------------------------------
procedure TWenDangForm.Button17Click(Sender: TObject);
var Yue,Ri,DToS,LianJie: string;
begin
//定位目录
DToS:=DateToStr(DBText3.field.Value);
Yue:=Copy(DToS,6,2);
Ri:=Copy(DTos,9,2);
LianJie:=Yue+Ri;
LianJie:=LianJie+'\'+IntToStr(DBText1.Field.Value);
//判断位置
OpenName:=ComboBox9.Text+'\'+LianJie+'\r.doc';
//打开文件
if FileExists(OpenName) then
begin
wordapplication1.Visible:=true;
WordApplication1.Documents.Open(OpenName,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam)
end
else
ShowMessage(OpenName+'不存在');
end;
//-----------------------------------------------------
procedure TWenDangForm.Button18Click(Sender: TObject);
var Yue,Ri,DToS,LianJie,ZhuangH: string;
begin
//定位目录
DToS:=DateToStr(DBText3.field.Value);
Yue:=Copy(DToS,6,2);
Ri:=Copy(DTos,9,2);
LianJie:=Yue+Ri;
LianJie:=LianJie+'\'+IntToStr(DBText1.Field.Value);
ZhuangH:=IntToStr(DBText2.Field.Value);
OpenName:='';
//判断.doc位置
if DBText4.Field.Value='图书馆' then
OpenName:=ComboBox10.Text+'\'+LianJie+'\图'+ZhuangH+'.doc'
else if DBText4.Field.Value='档案馆' then
OpenName:=ComboBox10.Text+'\'+LianJie+'\档'+ZhuangH+'.doc'
else
OpenName:=ComboBox10.Text+'\'+LianJie+'\地'+ZhuangH+'.doc';
//打开文件
if FileExists(OpenName) then
begin
wordapplication1.Visible:=true;
WordApplication1.Documents.Open(OpenName,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam)
end
else //如果*.doc不存在,则判断*.jpg文件是否存在
begin
MuLuName:='';
if DBText4.Field.Value='图书馆' then
MuLuName:=ComboBox10.Text+'\'+LianJie+'\图'+ZhuangH+'.jpg'
else if DBText4.Field.Value='档案馆' then
MuLuName:=ComboBox10.Text+'\'+LianJie+'\档'+ZhuangH+'.jpg'
else
MuLuName:=ComboBox10.Text+'\'+LianJie+'\地'+ZhuangH+'.jpg';
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end
end;
procedure TWenDangForm.Button20Click(Sender: TObject);
var Yue,Ri,DToS,LianJie: string;
begin
DToS:=DateToStr(DBText3.field.Value);
Yue:=Copy(DToS,6,2);
Ri:=Copy(DTos,9,2);
LianJie:=Yue+Ri;
case PageControl3.ActivePageIndex of
0:begin
if rbh18.Checked=true then
MuLuName:=ComboBox8.Text+'\'+LianJie+'\18sd.jpg';
if rbh20.Checked=true then
MuLuName:=ComboBox8.Text+'\'+LianJie+'\20sd.jpg';
if rbh25.Checked=true then
MuLuName:=ComboBox8.Text+'\'+LianJie+'\25sd.jpg';
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
1:begin
if rbh18.Checked=true then
MuLuName:=ComboBox11.Text+'\'+LianJie+'\18b.jpg';
if rbh20.Checked=true then
MuLuName:=ComboBox11.Text+'\'+LianJie+'\20b.jpg';
if rbh25.Checked=true then
MuLuName:=ComboBox11.Text+'\'+LianJie+'\25b.jpg';
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
end;
end;
procedure TWenDangForm.Button15Click(Sender: TObject);
begin
OpenName:=ComboBox12.Text+'\JingZaiJianCe.doc';
//打开文件
if FileExists(OpenName) then
begin
wordapplication1.Visible:=true;
WordApplication1.Documents.Open(OpenName,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam)
end
else
ShowMessage(OpenName+'不存在。');
end;
procedure TWenDangForm.Button16Click(Sender: TObject);
begin
if DBText4.Field.Value='图书馆' then
MuLuName:=ComboBox13.Text+'\T'+inttoStr(DBText2.Field.Value)+'.jpg'
else if DBText4.Field.Value='档案馆' then
MuLuName:=ComboBox13.Text+'\Da'+inttoStr(DBText2.Field.Value)+'.jpg'
else
MuLuName:=ComboBox13.Text+'\D'+inttoStr(DBText2.Field.Value)+'.jpg';
//open file
if FileExists(MuLuName) then
FindAcdsee
else
ShowMessage(MuLuName+'不存在');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -