W
wglifs
Unregistered / Unconfirmed
GUEST, unregistred user!
用Delphi调用一个专业打印软件,因为那里面有做好的一个格式,里面包含一些变量,现在就是要把Delphi程序里的变量传送过去,传送完后并且打印。我有VB写的一个例子,它能做到,Delphi能做到吗?
附VB代码:
Sub PrnLbl()
Set BtApp = CreateObject("BarTender.Application" 'Call BarTender
Set BtFormat = BtApp.Formats.Open(gPrnFName) 'Call label format file
BtFormat.SetNamedSubStringValue "TCustNo", gCustNo
BtFormat.SetNamedSubStringValue "TName", gName
BtFormat.SetNamedSubStringValue "TOrder", gOrder
BtFormat.SetNamedSubStringValue "TVer", gVer
BtFormat.SetNamedSubStringValue "BBar", gBcode
BtFormat.SetNamedSubStringValue "MachineNo", gMachineNo
BtFormat.SetNamedSubStringValue "SnNum", gPrnNum
BtFormat.PrintOut
BtFormat.Close (BarTender.BtSaveOptions.btDoNotSaveChanges) 'Close label format
BtApp.Quit 'Exit BarTender
End Sub
附VB代码:
Sub PrnLbl()
Set BtApp = CreateObject("BarTender.Application" 'Call BarTender
Set BtFormat = BtApp.Formats.Open(gPrnFName) 'Call label format file
BtFormat.SetNamedSubStringValue "TCustNo", gCustNo
BtFormat.SetNamedSubStringValue "TName", gName
BtFormat.SetNamedSubStringValue "TOrder", gOrder
BtFormat.SetNamedSubStringValue "TVer", gVer
BtFormat.SetNamedSubStringValue "BBar", gBcode
BtFormat.SetNamedSubStringValue "MachineNo", gMachineNo
BtFormat.SetNamedSubStringValue "SnNum", gPrnNum
BtFormat.PrintOut
BtFormat.Close (BarTender.BtSaveOptions.btDoNotSaveChanges) 'Close label format
BtApp.Quit 'Exit BarTender
End Sub