DELPHI添加CodeSoft提供的ActiveX控件

DELPHI添加CodeSoft提供的一个ActiveX控件

 

我在网上有找到一个朋友发的解决方案,在此我再转述一遍:我使用是DELPHI 2009

 1.打Delphi后,点File-》New——》Package
    2.点Component-》Import Component-》选择Import Activex Control
    3.点Add按钮,选择CodeSoft的ActiveX控件OLE库文件Lppx2.tlb
    4.点Next按钮,然后在Palette Page 选择Activex,其它默认
    5. 点Next按钮后选择最后 一项,Add Unit to project1.dproj project (应该解决为添加至现在的文件内)
    6.点Finish后,然后在右边的项目文件管理中,右击项目文件,选择Install,安装即可
    7.重新打开Delphi后就不会再有异常提示了

 

 

 

 

当安装完成后 ,调用LabelManager2_TLB,调用代码大致如下。

 

uses
  
  LabelManager2_TLB;

type
  TPrintLabel = class(TForm)
    
    Application1: TApplication; 

 

 

 

Application1.Connect;  
Application1.Documents.Open(CodeTemplateFileName,false);          打开模板文件 

给模板变量赋值
Application1.ActiveDocument.Variables.Item('BARHEAD').Value:="";
Application1.ActiveDocument.Variables.Item('BAR').Value:="";
Application1.ActiveDocument.Variables.Item('BARBACK').Value:="";
Application1.ActiveDocument.Variables.Item('CODEHEAD').Value:="";
Application1.ActiveDocument.Variables.Item('CODE').Value:="";
Application1.ActiveDocument.Variables.Item('CODEBACK').Value:="";

打印
Application1.ActiveDocument.PrintDocument(m);

 

你可能感兴趣的:(DELPHI添加CodeSoft提供的ActiveX控件)