In the last blog, I started out with a simple label printing application using the DLS SDK. If you are planning on using the SDK, you’ll need to become familiar with two objects that will do the bulk of label printing work in your application. The first one the DymoAddin object, the other is the DymoLabels object. We will examine on the DymoAddin object in this post.
Background
The DymoAddin object got its name from the time when DYMO needed to create addins for 3rd party applications. Instead of re-writing all the label printing code in a separate library, then using the library to implement the 3rd party addins (like the DLS MS Office Addins, DLS ACT! Addin, DLS QuickBooks Addin), we simply added a COM interface to the DLS application so we can leverage the label printing functionality from the DLS application. The first interface exposed was called the IDymoAddin interface, and the object that implemented the interface was called the DymoAddin object.
There are many methods exposed in the IDymoAddin interface, however, only a part of it is really intended for the SDK. The methods that don’t fall in this group are there because we (i.e. DYMO) needed it to implement some functionality for the addins we write for other applications. Call it lack of planning or oversight, these methods and properties that are really meant for internal DYMO use are lumped together in the same IDymoAddin interface that is used for SDK applications. For the most part, you should avoid using these methods and properties in your application. But as you sit down to understand the DLS SDK and design your own application, you’ll likely find that these methods and properties are too specialized and are not needed for your SDK application.
But what are these functions and methods that you shouldn’t use? Instead of listing them here, I will instead focus on the methods that are meant to be used by SDK applications.
Main Functionality
In the last blog, I outlined the three main concepts used in the DLS SDK. The first is the concept of a label file. The main functionality of the DymoAddin object is to implement the IDymoAddin interface, which provides operations you can perform on a label file, including opening, saving, and printing a label file. Because printing is part of the functionality, the IDymoAddin interface also provides methods to list and select DYMO printers for use in your SDK application. I will explore these methods and their usage (in C#) below.
File Operations
The Open(), Save(), and SaveAs() methods combined to give you the ability to open and save labels on your computer’s local file system. The same operations can be used on network storage if the storage location is addressable using UNC (i.e. Universal Naming Convention).
The following example shows how to open a label file and then save it with a different file name:
1 private void FileOperatoinsExample() 2 { 3 DymoAddInClass _dymoAddin = new DymoAddInClass(); 4 5 // open a label file using absolute path, relative path 6 // or UNC (for network accessible locations) 7 if (_dymoAddin.Open(@"..\Labels\Sample.label")) 8 { 9 _dymoAddin.SaveAs(@"..\Labels\SampleCopy.label"); 10 } 11 12 if (_dymoAddin.Open(@"C:\Users\ckhsu\Labels\Sample.label")) 13 { 14 _dymoAddin.SaveAs(@"C:\Users\ckhsu\labels\SampleCopy.label"); 15 } 16 17 if (_dymoAddin.Open(@"\\File Server\Shared\Labels\Sample.label")) 18 { 19 _dymoAddin.SaveAs(@"\\File Server\Shared\Labels\SampleCopy.label"); 20 } 21 } 22
Web Applications
Sometimes the label file you need is located in the cloud and you need to access it using an URL. The OpenURL() method is created for this purpose.
Proxy Server and Proxy Bypass
The OpenURL() method is implemented using WinInet. This means that the user’s proxy settings in IE is used when calling the OpenURL(). But depending on your application, this might not be desirable. You can use the following methods and properties to control proxy settings used for the OpenURL() method. These settings are good for the lifetime of the DymoAddinObject, but are not persistent beyond that. So if you free and create another instance of the DymoAddinObject, you will need to setup the custom proxy settings again for the next OpenURL call.
- ProxyBypass property – set to True to bypass all proxy servers. When this property is set to True, it overrides all other proxy settings.
- SetupProxySettings() method – setup custom proxy settings.
- ClearProxySettings() method – clear all proxy settings and revert back to using IE’s proxy settings.
The following example shows how to open a label file using an URL.
1 private void URLFileOperatoinsExample() 2 { 3 DymoAddInClass _dymoAddin = new DymoAddInClass(); 4 5 // use custom proxy setup. 6 // by default, the OpenURL() method uses the same proxy 7 // settings as IE 8 _dymoAddin.proxyBypass = false; 9 _dymoAddin.SetupProxySettings("http", "dymo_proxy_server", 80, "*.internal.dymo.*", "", ""); 10 11 // open a label file using URL 12 if (_dymoAddin.OpenURL("http://www.mylabelprinter.com/labels/shipping.lwl")) 13 { 14 _dymoAddin.SaveAs(@"Labels\SampleCopy.label"); 15 } 16 } 17
Database Operations
If your application uses a database to store label files, you can use the OpenStream() and SaveStream() methods to open and save label files using memory buffers.
The following example shows how to open and save label files into memory buffers:
1 private void OpenAndSaveStreamExample() 2 { 3 DymoAddInClass _dymoAddin = new DymoAddInClass(); 4 5 // this is the buffer that will hold an array of bytes 6 object buf = null; 7 8 if (_dymoAddin.Open(System.IO.Path.Combine( 9 System.IO.Directory.GetCurrentDirectory(), 10 @"DatabaseLabel.label"))) 11 { 12 // get an array of bytes from Save Stream 13 buf = _dymoAddin.SaveStream(); 14 15 // at this point, you can store buf as a blob 16 // in your database 17 byte[] blob = (byte[])buf; 18 } 19 20 // to open a label file from a blob in your database 21 // first, read the blob into into an array of bytes 22 // then pass the array of bytes to OpenStream 23 System.IO.MemoryStream ms = new System.IO.MemoryStream(); 24 25 // the following line is psuedo code aimed to illustrate how one 26 // might read a blob into an array of bytes 27 !!!Database.Table("Labels Table").Field("Shipping Label").SaveToStream(ms); 28 29 // at this point, you can read the bytes 30 _dymoAddin.OpenStream(ms.GetBuffer()); 31 } 32
Printer Related Operations
The DLS SDK (and therefore your SDK applications) can only be used with LabelWriter printers. Because of this, we added printer listing and selection methods to filter out printers that are not compatible with the DLS SDK so your application will not need extra code to deal with printer compatibility and selection issues.
The following example shows how to get a list of LabelWriter printers installed on the computer, and selects a printer named “My LabelWriter” to print a label file:
1 private void SelectPrinterAndPrintLabelExample() 2 { 3 DymoAddInClass _dymoAddin = new DymoAddInClass(); 4 5 string[] printers = _dymoAddin.GetDymoPrinters().Split(new char[] { '|' }); 6 foreach (var printer in printers) 7 { 8 // find the printer we want to print to 9 if (printer == "My LabelWriter") 10 { 11 // select it first 12 _dymoAddin.SelectPrinter(printer); 13 14 // then print the currently open label 15 if (_dymoAddin.IsTwinTurboPrinter(printer)) 16 { 17 // print one copy of label to the left tray 18 _dymoAddin.Print2(1, false, 0); 19 } 20 else 21 { 22 // print one copy of label to the only tray 23 _dymoAddin.Print(1, false); 24 } 25 break; 26 } 27 } 28 } 29
A new method worth mentioning is the IsPrinterOnline() method, which return the online/offline status of a printer.
Conclusion
Although the DymoAddin object’s name may not invoke any ideas of the functionality it provides, it is an important part of the because of the rich features it provides. I hope this blogs gives you a good idea of the DymoAddin object’s capabilities and how to best use the capabilities for your specific application.

Hi,
I have a working Excel VBA application on XP & Excel2003 with a older version of the DLS8 SETUP.
Because of rumors that the company will switch to Win7 / Office2010 i’m trying to get it working on my PC at home
(VISTA / Exel2007), and hope it will work then also on Win7 & Excel2010.
I don’t have a 450Turbo printer at home too.
I installed the DLS8Setup.8.3.1.1332 on the Vista (without a 450 Turbo printer connected at the end of the installation) and checked the checbox ‘DYMO Label software V.8 SDK’ in the VBE references listbox.
I use the same XLA utility as on the XP / Excel2003 machine, but it won’t work at all.
I can’t create the ‘Dymo.DymoAddin’ object.
Here below a snipset of the VBA code.
Anyone any clue why it can’t create the Dymo.DymoAddin object, but does on the XP/ Excel2003 machine?
I need to get it working before the switch to Win7 / Office2010.
Could it be that its because i haven’t connected a DYMO printer at the end of the installation?
——————————————————-
Sub TestIfOnline()
If CreateDymoPrinterObjects Then
Application.Cursor = xlWait
With g_oDymoPrinter
g_sDymoPrintername = .GetCurrentPrinterName
g_bOnLine = .IsPrinterOnline(g_sDymoPrintername)
End With ‘//g_oDymoPrinter
If Not g_bOnLine Then
g_iMyErrorNumber = 1
frmError.Show
End If
Application.Cursor = xlDefault
End If
End Sub
———————————————————
Function CreateDymoPrinterObjects() As Boolean
‘This fuction creates IDYMOAddIn object
On Error Resume Next
If (g_oDymoPrinter Is Nothing) Then
Set g_oDymoPrinter = CreateObject(“Dymo.DymoAddin”) ‘
End If
CreateDymoPrinterObjects = (Err = 0)
If Not CreateDymoPrinterObjects Then
MsgBox “Unable to create OLE objects: Dymo.DymoAddin”
End If
End Function
——————————————–
Any help welcome.
Regards,
Ludo
Comment by Ludo Soete — October 5, 2011 @ 3:17 am |
I have version 8.3.1.1332.
I note that in the Dymo_TBL, there are separate IDymoAddins up to IDymoAddin5. Numbers 4 and 5 have procedures for IsTwinTurboPrinter. However, if I try to create an IDymoAddin4 object, I get a Class not registered error message and can’t create the ActiveX object with code below
const
//Dymo Library classes names:
IDymoAddInName = ‘Dymo.DymoAddIn4′;
IDymoLabelsName = ‘Dymo.DymoLabels’;
{ TDymoLabel }
constructor TDymoLabel.create(aOwner: TComponent);
begin
inherited create(aOwner);
//Create Dymo Label ActiveX objects.
try
DL := CreateOleObject(IDymoAddInName) as IDymoAddIn4;
LB := CreateOleObject(IDymoLabelsName) as IDymoLabels;
except
MsgWarning(‘Unable to create Dymo Label ActiveX objects.’);
end;
end;
Does this suggest that the Dymo 8 software has not installed all the classes required and that maybe that is why I cannot get the fields in the label file for the .label files. I was just using the base IDymoAddin object and using the code below which was passed a stringlist of field names and data and the label file to print to get the fields from the label file and print the label. The LB.GetObjectNames(True), didn’t return anything. Also included below is the contents on the .label file.
procedure TDymoLabel.InstantPrintLabel(FieldValues: TStringlist; LabeFile: string;
aCopies: byte = 1; PrintIt: boolean = True);
var
ObjectList: String;
FieldList: tstringlist;
i: integer;
begin
//Create Dymo Label ActiveX objects.
if fileexists(LabeFile) then begin
DL.Open(LabeFile);
FieldList := TStringlist.create;
ObjectList := LB.GetObjectNames(false);
TokenToStringList(LB.GetObjectNames(True),’|',FieldList);
For i := 0 to FieldList.Count – 1 do
LB.SetField (FieldList[i], StrToDef(RepStr(FieldValues.values[FieldList[i]],’/n’,#13#10),’ ‘));
FieldList.free;
if PrintIt then
DL.Print(aCopies, false);
end
else
LogAppError(‘File not found ‘ + LabeFile,1,”);
end;
Landscape
Shipping
30323 Shipping
CLIENTSHORTNAME
Rotation180
False
True
Left
Top
ShrinkToFit
True
False
Client short name
CLIENTSHORTNAME2
Rotation0
False
True
Left
Top
ShrinkToFit
True
False
Client short name
Thanks
Comment by Kevin Kane — October 4, 2011 @ 4:40 am |
First, COM-class ProgID and the interface name(s) the class support are different things. So, in your code you have to create the object by providing its ProgID, that is ‘‘Dymo.DymoAddIn’, not ‘Dymo.DymoAddIn4′. You still can cast/QueryInterfrace the object to IDymoAddIn4 if you need to access the new methods defined by this interface. Second, it is hard to say why you don’t get object names without debugging. Here are some tips:
– make sure DL.Open(LabeFile) completed succe3ssully. The call returns True on success, False otherwise. If it returns False, make sure the label file does exists, and it is a valid label file. To check it is a valid label file, try to open it using DYMO Label software v8.
– call LB.GetObjectNames(True) and check the result. It should be non-empty string, assuming your label file loaded correctly and the label file contains some label objects.
– install DebugView, run it, run your application, look for any error messages in DebugView
Comment by Vladimir — October 4, 2011 @ 5:57 am |
Hi Vladimir,
Setting the class correctly and using the DymoAddin4 appears to have solved the problems. I am now getting the fields in the .label labels as well as being able to process labels created with earlier versions of the Dymo software.
Many thanks for your help with this.
Comment by Kevin Kane — October 6, 2011 @ 6:01 am |
Anytime
Comment by Vladimir — October 6, 2011 @ 7:31 am |
I have a Delphi application using the Dymo COM objects.
Some of our users are starting to install Dymo LabelWriter 450 Twin Turbo machines with Dymo v 8 software. Labels saved using this are in the .label format.
The SDK library procedures for GetObjectNames that worked in the previous versions of the Dymo labels do not work with the .label formats.
I loaded down the SDK for version 8 but that has no Delphi support options like the previous versions did. The code also needs to be able to work with all versions of Dymo software and printers.
Are there any options for me to get around this?
Comment by Kevin Kane — September 20, 2011 @ 12:50 pm |
There are two ways to fix this. Ether install an update to DLS7 that adds LW450 support, http://www.dymo.com/media/Software/DLS_7_Update.zip; or make sure the customers install the latest version of DLS8, as of 2011-09020 it is 8.3.1, http://download.dymo.com/download/Win/DLS8Setup.8.3.1.1332.exe. The latter way is more preferred in a long run.
Comment by Vladimir — September 20, 2011 @ 10:30 pm |
Thanks for the response Vladimir.
However, this does not get around my issue that I want to have access to SDK functionality within my Delphi software to support the v8 Dymo software (I can sort out having separate functionality to cope with different sites running different versions of the Dymo labels), but the SDK for v8 does not include any Delphi COM objects that allow me to communicate with labels created in v8 with the .label extensions.
Comment by Kevin Kane — September 21, 2011 @ 10:35 am |
The SDK API in DLS8 is backward compatible, really it provides EXACTLY the same COM interfaces. You can just install DLS 8.3.1 and use your application without recompilation.
Comment by Vladimir — September 21, 2011 @ 11:50 am |
Thats fantastic that it is backwards compatible which should mean I don’t have to change my code for the different versions of Dymo printers and label templates.
However, this still leaves me with the fact that there is nothing in the v8 SDK for Delphi. What I was expecting was to have a Delphi directory under High Level Com that contained the Dymo_TBL.pas file that contained the procedures to interface with the printers as there was in the previous versions of the SDK. With the SDK for version 7, the GetObjectNames procedure does not return the objects in a v8 .label template presumably because it doesn’t know that the template file is now an XML document. Therefore I cannot assign contents to the fields on the label so when it then goes to print the label it just produces a blank label.
Comment by Kevin Kane — September 21, 2011 @ 12:14 pm |
Make sure you have DLS 8.3.1 installed
Comment by Vladimir — September 21, 2011 @ 2:13 pm |
I have Dymo Label 8.3.1.1332 and the DYMO Label v.8 SDK (not sure if there is any version number assigned to that) which has a DLS 7 Compatibility Library directory that has a Samples directory which contains a High Level COM directory – under this there are directories for dotNet, Firefox, etc but not one for Delphi as there was in the DLS_SDK for version 7.
Comment by Kevin Kane — September 22, 2011 @ 5:26 am |
Yes, Delphi samples were excluded from DLS8 SDK installer. Please, notice, that the SDK installer contains documentation and samples only, not libraries. Libraries are included with DLS installer itself. And the SDK API is fully binary compatible, although the implementation is different. You can install DLS7 SDK to view old Delphi samples, it is available on http://sites.dymo.com/DeveloperProgram/Pages/LW_SDK_Windows.aspx, http://download.dymo.com/Download%20Drivers/Software%20for%20DYMO%20LabelWriter/Downloads/13/WIN_DLS_SDK_0508.EXE.
If you want to recreate Dymo_TLB.pas (though it is not necessary), use “Project/Import Type Library” menu item in Delphi7, select “DLS SDK COM Type Library”, and press “Create Unit” button.
Now, if you still have a problem (after installing DLS 8.3.1) with GetObjectNames method, please send the label file and the code fragment shows how you call the SDK. Thanks you.
Comment by Vladimir — September 22, 2011 @ 7:32 am
I cannot get the DymoAddIn.open() working it just return false. any advice ( i am using VC sharp).
Comment by Roberto — July 22, 2011 @ 8:37 am |
make sure you have the latest DLS version installed, that at time of writing is 8.3.0.1242 available from here.
Comment by Vladimir — July 22, 2011 @ 11:03 am |
Hi!
I need to print tape labels via the lower print head of the LabelWriter Duo.
I am using VBA (or VB6, if you prefer) with Access 2010. The ‘old’ DLS calls no longer work with the new Ver. 8 DLS! What happened to ‘DymoTapeAddIn’?
Please, where is the documentation for the new VBA ver. 8 framework & examples?? I have donwloaded two versions of your SDK and neither one contains the info required to deal with VBA.
Where did the declarations such as ‘DYMO_DLS_SDK.DymoHighLevelSDK’ shown in post #5 come from? I haven’t seen this in any docs from Dymo.
I really need this info soon.
Thanks in advance!
Comment by Greg O'Drobinak — April 5, 2011 @ 5:33 am |
IDymoTapeAddIn is not supported in DLS8. To print on a tape printer you have to use DYMO Label Framework API. Unfortunately there is almost zero documentation and samples for the COM part of the API. You could kind of deduct it the usage from the TLB file and .NET documentation available in BETA SDK in [My Documents]\DYMO Label\SDK\DYMO Label Framework\doc\DYMOLabelFramework.chm. I know, it is very limited, and I apologize for inconvenience. As for VBA sample, you can find a Access 2010 sample database here.
Comment by Vladimir — April 5, 2011 @ 9:59 am |
Hi,
We have web page with javascript which is generating and printing label. It works fine with Internet Explorer in version 6. But now some users upgraded IE to version 8. With IE script fails with error “Automation server can’t create object” when DymoAddIn object is being created in the javascript code:
var DymoAddIn = new ActiveXObject(“Dymo.DymoAddIn”);
Can you advise how to deal with this issue?
Comment by Krzysztof — March 1, 2011 @ 9:14 pm |
Make sure users have DYMO Label 8.3 installed. Also, make sure ActiveXs are enabled in IE settings.
Comment by Vladimir — March 1, 2011 @ 11:02 pm |
Hi Vladimir,
thanks for that – I will try installing the same version of the SDK on the customers machine – I didn’t think installing the SDK would be necessary so I only installed the drivers when installing the printer as I thought that my applications msi installer would include and install all of the files necessary for it to connect.
cheers and thanks for your replies
james
Comment by James — February 4, 2011 @ 4:57 am |
Hi there,
I have, on my Dev PC a LabelWriter 400 installed and my code for quick print on a single label works fine
When installed at the customer site, where they have a Dymo 460 printer I am getting the following error:
Unable to cast COM object of type ‘Dymo.DymoAddInClass’ to interface type ‘Dymo.IDymoAddIn5′. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{A1CD66DC-6A1F-4FD6-A7EF-57D00E28E00A}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0×80004002 (E_NOINTERFACE)).
I tried installing the customers drivers on my machine but it gives the same error here then
Dymo.DymoAddInClass dymo = new Dymo.DymoAddInClass();
dymo.SmartPasteFromString(sAddress); //errors on this line
I tried dymo.StartPrintJob() instead and declaring labels etc but ti then errored there instead.
What have i done wrong?? – any help much appreciated
Cheers James
Comment by James Carter — February 3, 2011 @ 12:47 am |
DYMO Label software should be installed on the customer machine.
Comment by Vladimir — February 3, 2011 @ 2:42 am |
Hi Vladimir,
I’m afraid you might have misunderstood me – I meant when the Application that I have written, that allows the users to print labels is installed on their site.
cheers james
Comment by James Carter — February 3, 2011 @ 4:30 pm |
Your application uses DYMO DLS SDK. So, DYMO DLS SDK libraries should be installed on the machine your application is running on. So, DYMO Label software should be installed on that machine, because DYMO Label software installer installs all needed libraries for an SDK application.
Comment by Vladimir — February 4, 2011 @ 1:13 am |
Hi again,
We use ‘normally’ Code128 and label 99017.
The scanned barcode to copy on the new labels is only build up with numbers 0 to 9.
The string lenght is 10 characters long ex: 1890221234
I noticed alreddy while experimenting that the barcode doesn’t fit always. I changed the barcode size from “Medium” to “Small” using the DYMO Label V8 application, and now it fit. For the moment i didn’t check how many characters there fit on the specified label.
Once i know that, i can write it also into the registry settings using something similar as following VBA code:
SaveSetting appname:=ThisWorkbook.Name, section:=”Startup”, key:=”LabelName”, setting:=DymoLabelName
So, knowing witch human readable character uses the most space in “Barcode bars / spaces” can help me determine the maximum number of allowed characters to scan.
According to what i found on Wikipedia is this the letter “X”, right?
Thanks again for the quick responce.
Regards,
Ludo
Comment by ludo Soete — January 12, 2011 @ 5:10 pm |
Hi,
I’m writing a little application for Excel 2003 using VBA.
So far i got something working but i would like to READ also the label Height, Width Left, … properties, but can’t figure out how to do.
Can someone help me?
Any help apreciated.
Sub PrintLabel()
‘deze routine werkt 100% !
‘
‘voor ontwikkel info zie : http://developers.dymo.com/
‘
Dim myDymo As DYMO_DLS_SDK.DymoHighLevelSDK
Dim DymoAddIns As DYMO_DLS_SDK.ISDKDymoAddin
Dim DymoLabels As DYMO_DLS_SDK.ISDKDymoLabels
Dim Q
Dim Cntr As Integer
‘preset values & objects
PrintString = frmDymo.tbBarcode.Value
‘skip if nothing to print
If PrintString “” Then
Set myDymo = New DYMO_DLS_SDK.DymoHighLevelSDK
Set DymoAddIns = myDymo.DymoAddIn
Set DymoLabels = myDymo.DymoLabels
PrintLabelCopies = frmDymo.tbPrintLabelCopies.Value
‘get printer
DymoAddIns.SelectPrinter DymoAddIns.GetDymoPrinters
‘get label
DymoAddIns.Open (ThisWorkbook.Path & “\Labels\” & DymoLabelName) ‘
‘**************
Dim objNames(20) As String
myObjectnames = DymoLabels.GetObjectNames(False) ‘<< returns ONLY the "MyBarcode" name.
'be sure to set the barcodeprint mode
DymoAddIns.SetGraphicsAndBarcodePrintMode (True)
'
DymoLabels.SetField "MyBarcode", PrintString
DymoAddIns.StartPrintJob
For Cntr = 1 To PrintLabelCopies
If DymoAddIns.IsTwinTurboPrinter(DymoPrintername) = True Then 'print one copy of label to the left tray
Q = DymoAddIns.Print2(PrintLabelCopies, False, 0)
Else
Q = DymoAddIns.Print(1, False) 'print one copy of label to the only tray
End If
PrintLabelCopies = PrintLabelCopies – 1
Next
DymoAddIns.EndPrintJob
'release objects
Set DymoLabels = Nothing
Set DymoAddIns = Nothing
Set myDymo = Nothing
Else
'
End If
End Sub
Regards,
Ludo
Comment by ludo Soete — January 10, 2011 @ 8:45 pm |
to do that you will need to use so called “low level” API. There is no sample in VBA, but the steps are: create LabelEngine object; access LblInfo by using LabelEngine.PrintObjects property; then you can get label properties like LabelWidth, LabelHeight, etc. See documentation for the detail, or C++ sample in the “Samples\Low Level COM” folder.
BTW, out of curiosity, what is your use case? why do you need to access those properties? Thanks.
Comment by Vladimir — January 11, 2011 @ 6:41 am |
Hi Vladimir,
Thanks for the fast feedback.
The main purpose of the little utility is as follow.
Using a hand scanner, we copy a barcode (Code 128) and printout a (few) copie(s) of it, without the need of clicking on a ‘Print’ button. So when ever the barcode is scanned, it will be automaticly printed in x copies. I dont think the the Excel add-in is able to do so, because i’m asked for this ‘enhancement’, thats why i’m writing this little application’.
I’m also no software engineer at all, i do it just because i like it to write some utilities for the group i’m working for. Pure interest.
Reading the label info ( + text position on the label) is informative info on the userform.
Could be of little interest if we want to print a too long text on a certain label.
I noticed that you get the text “Barcode doesn’t fit” on the label if the text is to long (or the size is too large to fit).
What i find as a shortcomming is the absence of little examples on how to use the components and there properties in the DLS 7 Compatibility Library Manual.pdf, like you find back in the Help (F1) in the VBA editor. Thats realy handy.
Regards,
Ludo
Comment by ludo Soete — January 11, 2011 @ 3:21 pm |
Thought it is possible to get barcode object position and size on the label, it will not help in determine is the actual barcode fit or not. Barcode object size is fixed, while the actual size of “bars/spaces” depends on the entered/scanned data. Depending on the barcode type you are using you might determine the maximum number of character a current barcode object can hold on a particular label and warn user if the number of entered/scanned character is greater. What barcode type are you using (Code39, Code128, etc)? Usually the barcode size depends on overall number of characters, not the characters themselves, thought sometimes it is important to know the exact string to encode…
Comment by Vladimir — January 12, 2011 @ 10:32 am |
sir,
i developed windows application with DYMO label writer400… , when published into server. when print page renders it is giving “retrieving the COM class factory for component with CLSID {09dafae2-8eb0-11d2-8e5d-11d2-8e5d-00a024-15e90f} fialed due to the following Error.”
please can you help how to render this page.
Thnaks Regards
manoj
Comment by R manoj kumar — August 5, 2010 @ 2:57 pm |
I can’t get the OpenURL() method to work. It always returns false. I’m doing this in Javascript in the browser. I have tried using a URL on the same domain as well as on another domain (should that make any difference?) It works neither in Firefox or IE. I’m not using any special Internet settings, and therefore haven’t configured any custom proxy. In Firefox the DLS SDK 1.2.0.4 is installed. It all works fine with a local file using Open(), but not using a URL with OpenURL(). I have version 8.2.2.996 of the software installed. How can I debug this? Possible to get specific error messages?
BTW, is there a complete language reference with all the methods and properties? The SDK 8.0 only contains the PDF “DLS 7 Compatibility Library Manual.pdf” which basically only describes certain enhancements to the original objects…
Comment by Allan Jensen — June 14, 2010 @ 3:47 am |
What does happen when you open the URL passed to OpenURL() directly in the browser? does the browser open it? I mean, verify that the URL is accessible.
As for documentation, “DLS 7 Compatibility Library Manual.pdf” contains a full list of supported methods, not the changed ones only. Please, read carefully.
Comment by Vladimir — June 14, 2010 @ 9:24 pm |
Hi,
I try a following cod snippet but I get 2 error in a code.
I marked both error on code (Here1, and Here2)
Imports System.ComponentModel
Imports System.Text
Imports Dymo
Public Class InsertNewParts
Private Sub Print_Label(ByVal sender As Object, ByVal e As EventArgs)
Dim _dymoAddin As New DymoAddInClass()
Dim _dymoLabel As New DymoLabelsClass()
‘Dim peldany As Int32 = Val(Me.TextBox1.Text)
‘ open the to-do-list label we created earlier
If _dymoAddin.Open(“C:\UserData\Dymo\dbarcode.label”) Then
‘ this call returns a list of objects on the label
Dim objNames() As String = _dymoLabel.GetObjectNames(False).Split(New Char() {“|”c})
‘ verify that our text object is on the label
If objNames.Contains(“code1″) Then <<<< Here1. 'Contains' is not a member of 'system.Array'
' take the to-do's list entered by the user
' and put in on the label
If _dymoLabel.SetField("todos", NewIdTbx.Text) Then
' let's print to the first LabelWriter available
' on the pc, if the printer is a TwiTurbo, print
' to the left tray
Dim printers() As String = _dymoAddin.GetDymoPrinters().Split(New Char() {"|"c})
For Each printer In printers <<< Here 2. Name 'printer' is not declared….
If printer Is "SpareP_LabelWriter" Then
' select it first
_dymoAddin.SelectPrinter(printer)
' then print the currently open label
If _dymoAddin.IsTwinTurboPrinter(printer) Then
' print one copy of label to the left tray
_dymoAddin.Print2(1, False, 0)
Else
' print one copy of label to the only tray
_dymoAddin.Print(1, False)
End If
End If
next
End If
End If
End If
End Sub
End Class
Visual Studio 2005
Net-framework 2.0
I wait for your answer.
Thanks and Regards
Robert
Comment by Robert — June 13, 2010 @ 7:34 pm |
for #1 – System.Array class does not have Contains method. Try Exists() or Find() instead.
for #2 – you did not declare Printer variable
Comment by Vladimir — June 14, 2010 @ 9:19 pm |
Hi Vladimir,
I try a following version (modification):
In the version not visible error, but after call the sub I get error messages….
This is a Sub:
Private Sub Print_Label()
Dim _dymoAddin As New DymoAddInClass()
Dim _dymoLabel As New DymoLabelsClass()
Dim printer As Object
‘ open the to-do-list label we created earlier
If _dymoAddin.Open(“C:\UserData\Dymo\dbarcode.lwl”) Then
‘ this call returns a list of objects on the label
Dim objNames() As String = _dymoLabel.GetObjectNames(False).Split(New Char() {“|”c})
‘ verify that our text object is on the label
If objNames.Equals(“WLOK_BARCODE”) Then
‘ take the to-do’s list entered by the user
‘ and put in on the label
If _dymoLabel.SetField(“WLOK_BARCODE”, NewIdTbx.Text) Then
‘ let’s print to the first LabelWriter available
‘ on the pc, if the printer is a TwiTurbo, print
‘ to the left tray
Dim printers() As String = _dymoAddin.GetDymoPrinters().Split(New Char() {“|”c})
For Each printer In printers
If printer Is “DYMO LabelWriter 400″ Then
‘ select it first
_dymoAddin.SelectPrinter(printer)
‘ then print the currently open label
If _dymoAddin.IsTwinTurboPrinter(printer) Then
‘ print one copy of label to the left tray
_dymoAddin.Print2(1, False, 0)
Else
‘ print one copy of label to the only tray
_dymoAddin.Print(1, False)
End If
End If
Next
End If
End If
End If
End Sub
This is the error:
System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2147221164
Message=”Creating an instance of the COM component with CLSID {09DAFAE2-8EB0-11D2-8E5D-00A02415E90F} from the IClassFactory failed due to the following error: 80040154.”
Source=”SPAREPART INVENTORY SYSTEM”
StackTrace:
at SPAREPART_INVENTORY_SYSTEM.NewParts.Print_Label() in C:\UserData\milus\VisualStudio_Projects\SPAREPART INVENTORY SYSTEM\SPAREPART INVENTORY SYSTEM\NewParts.vb:line 107
at SPAREPART_INVENTORY_SYSTEM.NewParts.Button1_Click(Object sender, EventArgs e) in C:\UserData\milus\VisualStudio_Projects\SPAREPART INVENTORY SYSTEM\SPAREPART INVENTORY SYSTEM\NewParts.vb:line 62
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at SPAREPART_INVENTORY_SYSTEM.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Comment by Robert — June 16, 2010 @ 8:53 pm |
if you are running Windows 32-bit, make sure you have the latest DYMO Label installed. You can download it from http://www.labelwriter.com/software/dls/win/DLS8Setup.8.2.2.996.exe
if you are running Windows 64-bit then there are two options:
– make your application 32-bit. http://www.google.com/search?hl=en&client=firefox-a&hs=TjD&rls=org.mozilla%3Aen-US%3Aofficial&q=compile+VB.NET+app+32-bit&aq=f&aqi=&aql=&oq=&gs_rfai=
– install DYMO Label 8.2.3 that has 64-bit support http://developers.dymo.com/2010/05/25/8-2-3-sdk-beta-release/
Comment by Vladimir — June 16, 2010 @ 9:15 pm |
Hallo Vladimir,
I hope you are fine.
My program running under 32 BIT, and WinXp
I installed latest program for printer (8.2.2.996)
I created label file etc. everything is fine.
But I when “click”
on Print button then nothing.. nothing happens, and the printer does not react, and then I do not receive an error messages
I attached ftp link with my test program src:
http://printsrc.freeweb.hu/src/PrintersBarcode.zip
I would like to ask for you if you have little free time then you would be able to test the program possibly what may be the trouble how?
Thanks and Regards
Comment by Robert — June 21, 2010 @ 2:55 am |
you have to debug your application a little bit.
you cannot call objNames.Equals(“todos”) because objNames is Array and “todos” is a String. Use Find or Exists instead.
check the printer name you are using, currently it is “DYMO LabelWriter 400″ Then” that is wrong.
Comment by Vladimir — June 22, 2010 @ 2:33 am |
I am trying to invoke the SaveStream method to get the bytes of a label. I get this exception:
Memory is locked. (Exception from HRESULT: 0x8002000D (DISP_E_ARRAYISLOCKED))
Any ideas?
This is running in an ASP .NET C# app using .NET 3.5. I am using the 8.2 SDK. I have tried several different versions but my code is this:
DymoAddInClass addIn = new DymoAddInClass();
if (addIn.Open(“HomeVisit.label”))
{
DymoLabelsClass labels = new DymoLabelsClass();
labels.SetField(“BARCODE”, “123456″);
labels.SetField(“TEXT”, “123456″);
labels.SetField(“TEXT_1″, “My Visit”);
labels.SetField(“TEXT_2″, “My Item”);
object theObject = addIn.SaveStream();
}
Comment by Jonathan — May 5, 2010 @ 12:12 am |
Hi,
Thank you for the question, it led me to find and fix a bug in the SDK. Anyway, here is the solution:
1. download the zip file containing the fix here.
2. extract the dll from the zip file into the \Program Files\DYMO\DYMO Label Software\ folder (you will be prompted to replace the existing file, click Yes).
3. rerun your application, the problem will be fixed.
Because DLS 8.2.2.x is just released, the fix will not be there. However, we are making a DLS 8.2.3 release shortly to support x64 SDK applications. The fix will be in that release. For now, you can use the zip file as a workaround. I apologize for the troubles.
Best,
CK
Comment by dymodev — May 6, 2010 @ 7:41 am |