C
ChrisK
Hi all,
I'm trying to send some text to a Dymo labelwriter printer using some code I
found in the Dymo SDK. Each time I print this, a label is printed but it's
blank - what have I missed here??
Dim FileStr As String, FileStrDDE As String
Dim PasteDDE As String, DDEStr As String, strPipe As String, Desc As String
Dim hKey As Long, cb As Long, path As String
strPipe = "|"
FileStr = "Address (30252, 30320).LWL"
'Read label files path from the Registry
RegOpenKeyEx HKEY_CURRENT_USER, "Software\DYMO\LabelWriter\Directories", 0,
KEY_ALL_ACCESS, hKey
RegQueryValueExNULL hKey, "Label Directory", 0&, REG_SZ, 0&, cb
path = String(cb, 0)
RegQueryValueExString hKey, "Label Directory", 0&, REG_SZ, path, cb
path = Left(path, cb - 1) + "\"
FileStrDDE = "Open(" + path + FileStr + ")"
On Error Resume Next
Call GetDesc(Desc) 'gets description of current
label
Call GetObject(Obj) 'defines object to paste text to
Call StartDDE 'opens the DDE conversation
DDEExecute Channum, FileStrDDE 'opens the template in DLS
using the correct label type
PasteDDE = "SetObjectText(" + Obj + "," + strTextToPrint + ")"
DDEExecute Channum, PasteDDE 'paste the text
DDEExecute Channum, "SetObjectText(Title," + BadgeTitle + ")"
DDEExecute Channum, "Print" 'print the label
Thanks and kind regards
ChrisK
I'm trying to send some text to a Dymo labelwriter printer using some code I
found in the Dymo SDK. Each time I print this, a label is printed but it's
blank - what have I missed here??
Dim FileStr As String, FileStrDDE As String
Dim PasteDDE As String, DDEStr As String, strPipe As String, Desc As String
Dim hKey As Long, cb As Long, path As String
strPipe = "|"
FileStr = "Address (30252, 30320).LWL"
'Read label files path from the Registry
RegOpenKeyEx HKEY_CURRENT_USER, "Software\DYMO\LabelWriter\Directories", 0,
KEY_ALL_ACCESS, hKey
RegQueryValueExNULL hKey, "Label Directory", 0&, REG_SZ, 0&, cb
path = String(cb, 0)
RegQueryValueExString hKey, "Label Directory", 0&, REG_SZ, path, cb
path = Left(path, cb - 1) + "\"
FileStrDDE = "Open(" + path + FileStr + ")"
On Error Resume Next
Call GetDesc(Desc) 'gets description of current
label
Call GetObject(Obj) 'defines object to paste text to
Call StartDDE 'opens the DDE conversation
DDEExecute Channum, FileStrDDE 'opens the template in DLS
using the correct label type
PasteDDE = "SetObjectText(" + Obj + "," + strTextToPrint + ")"
DDEExecute Channum, PasteDDE 'paste the text
DDEExecute Channum, "SetObjectText(Title," + BadgeTitle + ")"
DDEExecute Channum, "Print" 'print the label
Thanks and kind regards
ChrisK