I am trying to implement the Dymo SDK for printing labels on Dymo printers. An earlier app I created for printing on a Dymo printer downloaded an image to the printer and it worked fine. But I wasn’t printing barcodes. Even with the MBS barcode routines, the printed image is nowhere near as clear and crisp as when printed from the Dymo 8 program that comes with the printer. There is a solution based on an Access Example from the SDK docs that works, but not well in that it it does not recognize most of the objects on more complicated labels than a simple address label.
[quote=275107:@Dennis Hoskins]Dennis Hoskins 1 Jul 2016
The Dymo SDK is an interface to the Dymo Label software. The software has some features such as automatically generating and printing the IMDB postal barcode for an “address” field placed on the label design. It can also auto fit the address to the label. For my present needs, no need to re-invent the wheel with Xojo code.
I continued to experiment and discovered that the Invoke method was the problem. The following test code worked perfectly:
Dim DymoAddIn As OLEObject
Dim DymoLabel As OLEObject
DymoAddIn = New OLEObject(“Dymo.DymoAddIn”)
DymoLabel = New OLEObject(“Dymo.DymoLabels”)
If DymoAddIn = Nil Or DymoLabel = Nil Then
MsgBox(“Unable to create OLE Objects”)
End
Dim f As String = “E:\Users\dgh\Documents\DYMO Label v.8 SDK” + _
“\DLS SDK\Samples\High Level COM\MS Access\Address (30252, 30320, 30572).LWL”
DymoAddIn.Open(f)
Dim label As String = “John Doe” + EndOfLine + _
“123 Main Street” + EndOfLine + _
“Anytown, NJ 00000”
DymoLabel.SetField(“Address”, label)
DymoAddIn.StartPrintJob
DymoAddIn.Print(1, True)
DymoAddIn.EndPrintJob[/quote]
I found a VB.Net example and tried implementing it but ran into a problem I can’t solve. I imported DYMO_DLS_SDK which comes with the free Dymo 8 program. Based on the VB example I entered
Dim myDymo As new DYMO_DLS_SDK.DymoHighLevelSDK
Dim dyAddin As new DYMO_DLS_SDK.ISDKDymoAddin
Dim dyLabel As DYMO_DLS_SDK.ISDKDymoLabels
Every time I try to create an instance of dyAddin or dyLabel, I get an error. There are no such properties in DYMO_DLS_SDK.DymoHighLevelSDK. The properties are in another class DYMO_DLS_SDK.IDymoHighLevelSDK, but that class is protected. Presumably, that class is loaded when the constructor runs, but the compiler does not let me get that far.
The VB.Net code is
[quote]Dim myDymo As DYMO_DLS_SDK.DymoHighLevelSDK
Dim dyAddin As DYMO_DLS_SDK.ISDKDymoAddin
Dim dyLabel As DYMO_DLS_SDK.ISDKDymoLabels
Set myDymo = New DYMO_DLS_SDK.DymoHighLevelSDK
Set dyAddin = myDymo.DymoAddin
Set dyLabel = myDymo.DymoLabels[/quote]