隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827222
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

          轉: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 閱讀(1316) 評論(0)  編輯  收藏 所屬分類: delphi
          主站蜘蛛池模板: 固安县| 石泉县| 楚雄市| 西盟| 察雅县| 婺源县| 衡山县| 天水市| 金寨县| 闽清县| 宜黄县| 南靖县| 荣成市| 兴安县| 合山市| 齐河县| 禹城市| 建德市| 喀什市| 景宁| 宜宾县| 北碚区| 宜阳县| 壶关县| 柳州市| 平潭县| 和顺县| 丘北县| 宁津县| 富蕴县| 云阳县| 西乌珠穆沁旗| 建平县| 武陟县| 乐至县| 手机| 阿拉善右旗| 芦溪县| 商水县| 宁乡县| 普定县|