轉:http://download.csdn.net/source/876883
Delphi+Codesoft 7.0
调用条码格式文件打印
procedure
TFormMain.btnPrintClick(Sender: TObject);
Var
s: string;
i :
Integer;
BarApp,BarDoc,BarVars:Variant; // OLE 变量
Begin
if not
FileExists(edtBClabelName.Text) then
begin
stat.Panels[2].Text := 'The
Barcode Document is not Exists.';
ShowMessage('The Barcode Document is not
Exists.');
Exit;
btnOpen.SetFocus;
end;
BarApp :=
CreateOleObject('lppx.Application');
//arApp.Visible:=True;
BarApp.Visible:=False;
BarDoc:=BarApp.ActiveDocument;
BarVars:=BarDoc.Variables;
BarDoc.Open(edtBClabelName.Text);
// 变量赋值
if chkParam.Checked
then
begin
BarDoc.Variables.Item('var1').Value:=
edtPN.Text;
BarDoc.Variables.Item('var2').Value:=
edtPartName.Text;
BarDoc.Variables.Item('var3').Value:=
edtDesc.Text;
end;
// 打印标签
Bardoc.Printlabel(seqty.Value);
//
Feed
BarDoc.FormFeed;
// 关闭
Bardoc.Close;
BarApp.Quit;
End;
如果报Undeclare identified 'CreateOleObject' 错误, 则引入ComObj 即可
posted on 2010-05-14 08:12
Ke 阅读(1296)
评论(0) 编辑 收藏 所属分类:
delphi