Hey Frans,
I have made an litle interface to send data to a Dymo labelwriter.
The interaction is based on OLE.
Herewith some code as a example.
EXTERN TEKST1
EXTERN TEKST2
EXTERN TEKST3
EXTERN TEKST4
EXTERN TEKST5
EXTERN TEKST6
EXTERN TEKST7
EXTERN TEKST8
EXTERN TEKST9
DymoAddIn, DymoLabels is object OLE dynamic
LabelFile is string
q is Variant
FileID is int
ReadRes, s_tekst is string
DymoAddIn = GetActiveObject("DYMO.DymoAddIn")
DymoLabels = GetActiveObject("DYMO.DymoLabels")
IF DymoAddIn = Null THEN
DymoAddIn = new object automation "DYMO.DymoAddIn"
END
IF DymoLabels = Null THEN
DymoLabels = new object automation "DYMO.DymoLabels"
END
LabelFile = "C:\Program Files\DYMO Label\Label Files\SL-Bakery.LWL"
DymoAddIn>>open(LabelFile)
FileID = fOpen("C:\SAPP\TEMP\Etiket.txt", foReadWrite)
IF FileID <> -1 THEN
LOOP
ReadRes = fReadLine(FileID)
IF ReadRes = EOT OR ReadRes = "" THEN BREAK
s_tekst = ExtractString(ReadRes,1,";")
s_tekst = ExtractString(ReadRes,2,";")
s_tekst = ExtractString(ReadRes,3,";")
s_tekst = ExtractString(ReadRes,4,";")
s_tekst = ExtractString(ReadRes,5,";")
DymoLabels>>SetField("TEKST1", ExtractString(ReadRes,1,";"))
DymoLabels>>SetField("TEKST2", ExtractString(ReadRes,2,";"))
DymoLabels>>SetField("TEKST3", ExtractString(ReadRes,3,";"))
DymoLabels>>SetField("TEKST4", ExtractString(ReadRes,4,";"))
DymoLabels>>SetField("TEKST5", ExtractString(ReadRes,5,";"))
DymoLabels>>SetField("TEKST6", ExtractString(ReadRes,8,";"))
DymoLabels>>SetField("TEKST7", ExtractString(ReadRes,10,";"))
DymoLabels>>SetField("TEKST8", ExtractString(ReadRes,7,";"))
DymoLabels>>SetField("TEKST9", ExtractString(ReadRes,11,";"))
q = DymoAddIn>>Print(1,True)
END
END
Kind regards,
Freddy Baert
Member of the Belgium-Netherlands Windev usergroup.
Hello,
Does anybody have a (simple) example of the use of a Dymo labelwriter?
What can I use best; OLE, DDE or DLL.
Regards, Frans