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 := '条形码文档不存在。';
ShowMessage('条形码文档不存在。');
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;
rar 文件大小:284.33KB