Hi,
I’m new to Xojo and am having a problem trying to use the Dymo Labelwriter SDK (the high level COM interface). I am using a VBA sample as a guide and have the following (partial) code:
Dim DymoAddIn As OLEObject
Dim DymoLabel As OLEObject
Dim objParam As OLEParameter
Dim openparam As Variant
Dim setparams(1) As Variant
Dim printparams(1) as Variant
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 label As String = ConvertEncoding("John Doe" + EndOfLine + _
"123 Main Street" + EndOfLine + _
"Anytown, NJ 00000", Encodings.UTF16)
Dim f As String = ConvertEncoding("E:\\Users\\dgh\\Documents\\DYMO Label v.8 SDK" + _
"\\DLS SDK\\Samples\\High Level COM\\MS Access\\Address (30252, 30320, 30572).LWL", _
Encodings.UTF16)
objParam = New OLEParameter
objParam.Type = OLEParameter.ParamTypeString
objParam.Position = 1
objParam.Value = f
openparam = objParam
DymoAddIn.Invoke("Open", openparam)
I am getting a runtime TypeMismatchException on the last line. The SDK documentation for the Open method is:
Open(const FileName: WideString)
I have tried without using the OLEParameter and just setting the openparam variant to the f string with the same runtime error. I have also tried without changing the string encoding to UTF16 - same runtime error.
Does anyone have any experience with the Dymo SDK or any suggestions on what I should try next?
I am on Windows 8.1 Pro.
Thanks for any help.
Dennis