EnableExplicit ; DYMO Label Software (DLS) have to be installed. ; This Include is created for DLS v.8+ (year 2015+). ; Maybe it works with lower version, but this is untested. ; Constants ; =========================================================== ; For Printers with more than one tray Enumeration DYMO_Tray #DYMO_Tray_Unknown = -1 #DYMO_Tray_Left = 0 #DYMO_Tray_Right = 1 #DYMO_Tray_Auto = 2 EndEnumeration ; for DYMO_SetAddressPOSTNET(POSTNET_Pos) #DYMO_POSTNET_Pos_None = "NONE" #DYMO_POSTNET_Pos_Top = "TOP" #DYMO_POSTNET_Pos_Buttom = "BUTTOM" ; not really needed, but nice to know #DYMO_False = #False ; 0 #DYMO_True = ~#DYMO_False ; -1 ; Initialize all needed components or release them ; =========================================================== DeclareDLL DYMO_Init() ; Use this BEFORE any use of DYMO_*() commands. ; Prevent any use of DYMO_*() procedures if return value is not #True. ; Return: #True or #False DeclareDLL DYMO_Release() ; Release all objects created with DYMO_Init() ; After using DYMO_Release() stop using any DYMO_*() command. ; If you want to reuse DYMO_* commands, you can call DYMO_Init() again. ; Return: void ; Manage Printer(s) and printing ; =========================================================== DeclareDLL DYMO_ExaminePrinters() ; Examine available DYMO printers ; Return: Number of available printers DeclareDLL.s DYMO_NextPrinter() ; Cycle through the List of DYMO-Printer examined with DYMO_ExaminePrinters() ; Return: Printer name or #Null$ if no more printers available DeclareDLL.s DYMO_GetCurrentPrinterName() ; Get the name of the currently selected printer ; Return: selected printer name DeclareDLL DYMO_SelectPrinter(PrinterName.s) ; Redirects output to the selected printer. PrinterName is of the ; form "Printer name on Port". Returns TRUE on success, FALSE ; on error. Example: ; To Select the , you would use the ; command: DYMO_SelectPrinter("DYMO LabelWriter EL60 on COM3:") ; Return: #DYMO_True or #DYMO_False DeclareDLL DYMO_IsTwinTurboPrinter(PrinterName.s) ; Returns TRUE if the specified printer (PrinterName) is a ; LabelWriter Twin Turbo, FALSE otherwise. ; Return: #DYMO_True or #DYMO_False DeclareDLL DYMO_SetPrintMode(HighQuality = #True) ; When "HighQuality" is set to TRUE (Default value), labels containing barcode(s) ; will print at high quality mode but the print speed is reduced. ; Unsetting this mode will cause all labels to print at the fasted print ; speed. DeclareDLL DYMO_GetCurrentPaperTray() ; Further Information: When the currently selected printer is a ; LabelWriter Twin Turbo, DYMO Label software attempts To ; associate a paper tray With the currently opened label file. As an ; example, If the last label printed on the left tray was "Address ; 30252" And the last label printed on the right tray was "Shipping ; 30323", then when the user opens a label file that uses the ; "Address 30252" paper size, DYMO Label software automatically ; sets the tray selection To left tray. ; Return: the current active paper tray ; Possible Return values include: ; #DYMO_Tray_Unknown = Unknown Tray (program user must specify) ; #DYMO_Tray_Left = Left Tray (Roll) ; #DYMO_Tray_Right = Right Tray (Roll) ; #DYMO_Tray_Auto = Auto Switch DeclareDLL DYMO_IsPrinterOnline(PrinterName.s) ; This applies to locally connected printers only. Shared printers ; always return true. Returns true if the specified printer is online, ; false if the printer is offline. ; Return: #DYMO_True or #DYMO_False DeclareDLL DYMO_StartPrintJob() DeclareDLL DYMO_StopPrintJob() ; Wrapping DYMO_PrintLabel() calls within the DYMO_StartPrintJob() and ; DYMO_EndPrintJob() calls will cause labels to be printed as pages of the ; same print job. ; The benefit is seen with reduced the print job. ; ; Example: ; ; this printing loop creates a 10 page print job ; DYMO_StartPrintJob() ; For i = 1 to 10 ; ; update some fields on the label ; DYMO_PrintLabel() ; print one label ; Next ; DYMO_StopPrintJob(); ; ; this code above will print labels much faster than the code below:  ; ; ; this printing loop creates 10 different one page print jobs ; For i = 1 to 10 ; ; update some fields on the label ; DYMO_PrintLabel() ; print one label ; Next ; ; Return: void DeclareDLL DYMO_PrintLabel(Copies = 1, Tray = #DYMO_Tray_Unknown, ShowDialog = #False) ; Prints the current label. "Copies" is the number of copies to print. ; "ShowDialog" controls the display of the print-progress dialog. If ; TRUE, then the dialog is displayed. Returns TRUE on success, ; FALSE on error. ; Note: When the currently selected printer is a LabelWriter Twin Turbo, this command defaults to ; use the left roll. ; Possible values For the "Tray" parameter include: ; #DYMO_Tray_Left = Left Roll ; #DYMO_Tray_Right = Right Roll ; #DYMO_Tray_Auto = Auto Switch - This puts the printer in a mode where it starts to ; print from the last printed roll and automatically switch over to the ; other roll when the starting roll runs out of paper. It continues to ; toggle back and forth between rolls as long as the user refills rolls ; once they become empty. This mode of printing is useful when the ; user is printing a large number of labels. ; Return: #DYMO_True or #DYMO_False ; Automatic creation of print-jobs ; =========================================================== DeclareDLL DYMO_SmartPasteFromClipboard() ; Parses text data in the Clipboard into records and prints a label for ; each record. ; Return: #DYMO_True if the operation was successful, ; #DYMO_False if the operation failed. DeclareDLL DYMO_SmartPasteFromFile(File.s) ; Parses comma or tab delimited data in a file into records and prints ; a label For each record. ; Return: #DYMO_True if the operation was successful, ; #DYMO_False if the operation failed. DeclareDLL DYMO_SmartPasteFromString(Text.s) ; Parses text data in "Text" into records and prints a label for each ; record. ; Return: #DYMO_True if the operation was successful, ; #DYMO_False if the operation failed. ; Manage .label files ; =========================================================== DeclareDLL DYMO_OpenMemory(*Buffer, BufferSize) ; Reads a label file from a buffer (vs. from a file or URL). This is ; useful If you intend to manage the binary data yourself. The ; buffer must be filled with the binary Data of the label file. ; Return: #DYMO_True if the label file was Read from the buffer correctly. ; #DYMO_False if the buffer is invalid. DeclareDLL DYMO_SaveMemory() ; Returns a pointer, which is actually containing ; the binary data of the label file currently open in DYMO Label ; software. ; You can use MemorySize() tu get the size of the buffer. ; If you not longer need the data use FreeMemory() ; Return: *Buffer DeclareDLL DYMO_OpenURL(URL.s) ; Opens a label file using an URL. The URL can start with http, https, ; ftp, or file, etc. ; Return: #DYMO_True if the file was opened successfully, ; #DYMO_False if the file does not exist. DeclareDLL DYMO_OpenLabel(File.s, ShowDialogBoxIfFail = #False) ; Opens a label file. Returns TRUE on success, FALSE on error. ; *Functional Difference Alert: ; The function will try to open the specified label file name With the .label extension first, even If ; the parameter specifies a different file extension. ; For example, If your application calls: ; DYMO_OpenLabel("mylabel.lwl") ; The function will try to look for the file in the following order: ; mylabel.label ; mylabel.lwl ; mylabel.lwt ; * The reason for this behavior has to do with how the implementation handles both ".lwl" and ; ".label" file formats. The implementation converts ".lwl" format into ".label" format internally ; before performing any actions on a label file. What this means is that when a label that was ; opened as ".lwl" will be saved as a ".label" file if the DYMO_SaveLabel() method is called. ; So if an SDK application opens a ".lwl" label file, modifies it, then saves the file. The file would ; be saved as a ".label" file. When the application returns to open the same ".lwl" file expecting to ; see the modifications, the DYMO_OpenLabel() procedure would need to open the ".label" file for the ; modification to be seen. ; If "ShowDIalogBoxIfFail" is set to TRUE and the specified file name is not found, opens the ; Label File Open dialog box. ; Return: #DYMO_True if the file was opened successfully, ; #DYMO_False if the file does not exist. DeclareDLL DYMO_SaveLabel(File.s = #Null$) ; Saves the current label. Returns TRUE on success, FALSE on ; error. If a "File" is given, saves the current label under a new name. ; *Functional Difference Alert: ; The function will save the specified label file name in the .label file extension, even if the ; parameter specifies a different file extension. ; For example, If your application calls: ; DYMO_SaveLabel("SomeFile.lwl") ; the function will save the file As "SomeFile.label". The label file is in the new DYMO Label v.8 ; .label file format. ; Manage Most Recently Used (MRU) .label files ; =========================================================== DeclareDLL DYMO_MRU_GetFileCount() ; Return: the number of files in the MRU label file list. DeclareDLL DYMO_MRU_OpenFile(Index) ; Returns a label file name from the MRU label files List. The "Index" ; parameter identifies which file name in the MRU to return. The ; index is zero-based and the file name DOES NOT include the file ; path or extension. Example: "SomeFile" DeclareDLL.s DYMO_MRU_GetFileName(Index) DeclareDLL DYMO_MRU_ExamineFiles() ; Examine available MRU files ; Return: Number of available Files DeclareDLL.s DYMO_MRU_NextFile() ; Cycle through the MRU-List examined with DYMO_MRU_ExamineFiles() ; Return: Filename or #Null$ if no more available ; Proxy-settings (for commands with URL) ; =========================================================== DeclareDLL DYMO_ProxySetup(Protocol.s, ServerName.s, Port.l, ProxyBypass.s, UserName.s, Password.s) ; Allows customized proxy settings (different from IE’s Default ; proxy settings). All URL related function calls in the SDK will ; adhere to these proxy settings. DeclareDLL DYMO_ProxyClearSettings() ; Clears all proxy settings and revert back to using IE’s default ; proxy settings. DeclareDLL DYMO_ProxyBypass(Set = #True) ; #False = default ; Setting the property to TRUE will cause all URL related SDK ; functions To bypass any proxy settings, including IE’s Default ; proxy settings. ; Setting the property to FALSE (the Default value) means all URL ; related SDK functions will use either IE’s Default proxy setting or ; the user specified proxy settings ; Manage currently loaded .label and modify objects ; =========================================================== DeclareDLL DYMO_ExamineObjects(VariableOnly = #True) ; Examine available objects in the current loaded label. If "VariableOnly" is set to ; TRUE then only variable Objects are examined. ; Return: Number of Objects DeclareDLL.s DYMO_NextObject() ; Cycle through the objects examined with DYMO_ExamineObjectes() ; Return: ObjectName or #Null$ if no more available DeclareDLL DYMO_GetAddressFieldCount() ; This procedure returns the number of address objects on the current ; label. Used to determine possible values for the index parameter of ; the DYMO_SetAddressPOSTNET() and DYMO_SetAddress functions. DeclareDLL.s DYMO_GetText(Object.s) ; Given an "Object" name returns the contents of the object. ; This operation only applies to address, barcode and text objects. DeclareDLL DYMO_SetAddress(Address.s, Index = 1) ; Given an "Index" of an address object, places the text in the object. ; The index is normally 1, but for designs with more than one ; address object, the index can be greater than one to select other ; address objects. ; Return: #DYMO_True on success or #DYMO_False on error DeclareDLL DYMO_SetField(Object.s, Text.s) ; Given an object name, and some text, changes the text of the object ; to have the new text. This operation only applies to address, ; barcode, and text objects. ; Return: #DYMO_True on success or #DYMO_False on error DeclareDLL DYMO_SetAddressPOSTNET(POSTNET_Pos.s, Index = 1) ; Given an index of an address object, changes the POSTNET ; barcode setting for the object. The index is normally 1, but for ; designs with more than one address object, the index can be greater ; than one to select other address objects. ; Position can be #DYMO_POSTNET_Pos_None, ; #DYMO_POSTNET_Pos_Top or #DYMO_POSTNET_Pos_Buttom ; Return: void DeclareDLL DYMO_PasteFromClipboard(Object.s) ; Paste text from the clipboard to an object by the given ; "Object" name. ; Return: #DYMO_True on success or #DYMO_False on error DeclareDLL DYMO_SetImageFile(Object.s, File.s) ; Load an image file to a graphic object by the given "Object" name. ; Return: #DYMO_True on success or #DYMO_False on error DeclareDLL DYMO_SetImageURL(Object.s, URL.s) ; Allows specifying URL as the image source for an image object on ; the label. ; Return: #DYMO_True on success or #DYMO_False on error DeclareDLL DYMO_PasteImageFromClipboard(Object.s) ; Paste image from the clipboard to an object by the given ; "Object" name. ; Return: #DYMO_True on success or #DYMO_False on error ; Internally used Procedures ; =========================================================== Declare INTERNAL_DYMO_Variant2Buffer(*Var.VARIANT);Return: *Mem Pointer (use FreeMemory() / MemorySize()) Declare INTERNAL_DYMO_Buffer2Variant(*Buffer, BufferSize);Return: *Variant, use VariantClear_() AND ClearStructure() !! ; some tests for the include ; =========================================================== CompilerIf Defined(INCLUDE_DYMO, #PB_Constant) ; if DYMO / DYMO_DLL is already included CompilerError "<" + #PB_Compiler_Filename + "> DYMO already included !!" CompilerElse #INCLUDE_DYMO = #True CompilerEndIf CompilerIf Defined(INCLUDE_COMATE, #PB_Constant) = #False ; if COMatePLUS is not included XIncludeFile "COMatePLUS/COMatePLUS_Residents.pbi" XIncludeFile "COMatePLUS/COMatePLUS.pbi" ;CompilerWarning "<" + #PB_Compiler_Filename + ~"> if you want to include other COMatePLUS Version, you have to include \"COMatePLUS.pbi\"" CompilerEndIf CompilerIf #PB_Compiler_Unicode = #False CompilerError "<" + #PB_Compiler_Filename + "> Needs Unicode!!" CompilerEndIf ; Structures ; =========================================================== Structure DYMO_Struct_COM AddIn.COMateObject Labels.COMateObject EndStructure Structure DYMO_Struct_RetVar NextPrinter.s GetCurrentPrinterName.s MRU_NextFile.s MRU_GetFileName.s NextObject.s GetText.s EndStructure Structure DYMO_Struct COM.DYMO_Struct_COM List Printers.s() List MRU_Files.s() List Objects.s() Initialized.i RetVar.DYMO_Struct_RetVar EndStructure ; Procedures ; =========================================================== ProcedureDLL DYMO_Init() Global DYMO.DYMO_Struct ; create needed COMate objects If Not DYMO\Initialized DYMO\COM\AddIn = COMate_CreateObject("Dymo.DymoAddIn") DYMO\COM\Labels = COMate_CreateObject("Dymo.DymoLabels") EndIf If DYMO\COM\AddIn And DYMO\COM\Labels DYMO\Initialized = #True EndIf ProcedureReturn DYMO\Initialized EndProcedure ProcedureDLL DYMO_Release() ; release COMate objects If DYMO\Initialized If DYMO\COM\AddIn DYMO\COM\Labels\Release() EndIf If DYMO\COM\Labels DYMO\COM\AddIn\Release() EndIf DYMO\Initialized = #False EndIf ClearList(DYMO\MRU_Files()) ClearList(DYMO\Objects()) ClearList(DYMO\Printers()) EndProcedure ProcedureDLL DYMO_ExaminePrinters() Protected Temp.s, i ClearList(DYMO\Printers()) ; get string vom dls Temp.s = DYMO\COM\AddIn\GetStringProperty("GetDymoPrinters()") ; split string and fill list For i = 0 To CountString(Temp, "|") AddElement(DYMO\Printers()) DYMO\Printers() = StringField(Temp, i + 1, "|") Next ResetList(DYMO\Printers()) ProcedureReturn ListSize(DYMO\Printers()) EndProcedure ProcedureDLL.s DYMO_NextPrinter() DYMO\RetVar\NextPrinter = #Null$ If NextElement(DYMO\Printers()) DYMO\RetVar\NextPrinter = DYMO\Printers() EndIf ProcedureReturn DYMO\RetVar\NextPrinter EndProcedure ProcedureDLL DYMO_SelectPrinter(PrinterName.s) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("SelectPrinter('" + PrinterName + "')") EndProcedure ProcedureDLL DYMO_IsTwinTurboPrinter(PrinterName.s) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("IsTwinTurboPrinter('" + PrinterName + "')") EndProcedure ProcedureDLL DYMO_GetCurrentPaperTray() ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("GetCurrentPaperTray()"); EndProcedure ProcedureDLL.s DYMO_GetCurrentPrinterName() DYMO\RetVar\GetCurrentPrinterName = DYMO\COM\AddIn\GetStringProperty("GetCurrentPrinterName()") ProcedureReturn DYMO\RetVar\GetCurrentPrinterName EndProcedure ProcedureDLL DYMO_StartPrintJob() DYMO\COM\AddIn\Invoke("StartPrintJob()") EndProcedure ProcedureDLL DYMO_StopPrintJob() DYMO\COM\AddIn\Invoke("EndPrintJob()") EndProcedure ProcedureDLL DYMO_OpenLabel(File.s, ShowDialogBoxIfFail = #False) If ShowDialogBoxIfFail ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("Open2('" + File + "')") Else ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("Open('" + File + "')") EndIf EndProcedure ProcedureDLL DYMO_SaveLabel(File.s = #Null$) If File = #Null$ ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("Save()") Else ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("SaveAs('" + File + "')") EndIf EndProcedure ProcedureDLL DYMO_PrintLabel(Copies = 1, Tray = #DYMO_Tray_Unknown, ShowDialog = #False) Select Tray Case #DYMO_Tray_Left, #DYMO_Tray_Right, #DYMO_Tray_Auto ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("Print2(" + Str(Copies) + "," + Str(ShowDialog) + "," + Str(Tray) + ")") Default ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("Print(" + Str(Copies) + "," + Str(ShowDialog) + ")") EndSelect EndProcedure ProcedureDLL DYMO_IsPrinterOnline(PrinterName.s) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("IsPrinterOnline('" + PrinterName + "')") EndProcedure ProcedureDLL DYMO_OpenMemory(*Buffer, BufferSize) Protected *Var.VARIANT Protected Ret = #False ; Create Variant bufffer and copy data *Var = INTERNAL_DYMO_Buffer2Variant(*Buffer, BufferSize) If *Var Ret = DYMO\COM\AddIn\GetIntegerProperty("OpenStream(" + Str(*Var) + " AS VARIANT BYREF)") VariantClear_(*Var) ClearStructure(*Var, VARIANT) EndIf ProcedureReturn Ret EndProcedure ProcedureDLL DYMO_SaveMemory() Protected *Var.VARIANT Protected *Ret = #Null ; get return *variant from property *Var = DYMO\COM\AddIn\GetVariantProperty("SaveStream()") If *Var *Ret = INTERNAL_DYMO_Variant2Buffer(*Var) ; allocate some memory and copy data VariantClear_(*Var) EndIf ProcedureReturn *Ret EndProcedure ProcedureDLL DYMO_OpenURL(URL.s) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("OpenURL('" + URL + "')") EndProcedure ProcedureDLL DYMO_MRU_ExamineFiles() Protected Temp.s, i ClearList(DYMO\MRU_Files()) ; get string from dls Temp.s = DYMO\COM\AddIn\GetStringProperty("GetMRULabelFiles()") ; split string and fill list For i = 0 To CountString(Temp, "|") AddElement(DYMO\MRU_Files()) DYMO\MRU_Files() = StringField(Temp, i + 1, "|") Next ResetList(DYMO\MRU_Files()) ProcedureReturn ListSize(DYMO\MRU_Files()) EndProcedure ProcedureDLL.s DYMO_MRU_NextFile() DYMO\RetVar\MRU_NextFile = #Null$ If NextElement(DYMO\MRU_Files()) DYMO\RetVar\MRU_NextFile = DYMO\MRU_Files() EndIf ProcedureReturn DYMO\RetVar\MRU_NextFile EndProcedure ProcedureDLL DYMO_MRU_GetFileCount() ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("GetMRULabelFileCount()") EndProcedure ProcedureDLL.s DYMO_MRU_GetFileName(Index) DYMO\RetVar\MRU_GetFileName = DYMO\COM\AddIn\GetStringProperty("GetMRULabelFileName(" + Str(Index) + ")") ProcedureReturn DYMO\RetVar\MRU_GetFileName EndProcedure ProcedureDLL DYMO_MRU_OpenFile(Index) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("OpenMRULabelFile(" + Str(Index) + ")") EndProcedure ProcedureDLL DYMO_SetPrintMode(HighQuality = #True) If HighQuality DYMO\COM\AddIn\Invoke("SetGraphicsAndBarcodePrintMode(#True)") Else DYMO\COM\AddIn\Invoke("SetGraphicsAndBarcodePrintMode(#False)") EndIf EndProcedure ProcedureDLL DYMO_SmartPasteFromClipboard() ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("SmartPasteFromClipboard()") EndProcedure ProcedureDLL DYMO_SmartPasteFromFile(File.s) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("SmartPasteFromFile('" + File + "')") EndProcedure ProcedureDLL DYMO_SmartPasteFromString(Text.s) ProcedureReturn DYMO\COM\AddIn\GetIntegerProperty("SmartPasteFromString('" + Text + "')") EndProcedure ProcedureDLL DYMO_ProxySetup(Protocol.s, ServerName.s, Port.l, ProxyBypass.s, UserName.s, Password.s) DYMO\COM\AddIn\Invoke("SetupProxySettings('" + Protocol + "','" + ServerName + "'," + Str(Port) + ",'" + ProxyBypass + "','" + UserName + "','" + Password + "')") EndProcedure ProcedureDLL DYMO_ProxyClearSettings() DYMO\COM\AddIn\Invoke("ClearProxySettings()") EndProcedure ProcedureDLL DYMO_ProxyBypass(Set = #True) ; #False = default If Set DYMO\COM\AddIn\SetProperty("proxyBypass = #True") Else DYMO\COM\AddIn\SetProperty("proxyBypass = #False") EndIf EndProcedure ProcedureDLL DYMO_ExamineObjects(VariableOnly = #True) Protected Temp.s, i ClearList(DYMO\Objects()) ; get string of objects If VariableOnly Temp.s = DYMO\COM\Labels\GetStringProperty("GetObjectNames(#True)") Else Temp.s = DYMO\COM\Labels\GetStringProperty("GetObjectNames(#False)") EndIf ; split string and fill list For i = 0 To CountString(Temp, "|") AddElement(DYMO\Objects()) DYMO\Objects() = StringField(Temp, i + 1, "|") Next ResetList(DYMO\Objects()) ProcedureReturn ListSize(DYMO\Objects()) EndProcedure ProcedureDLL.s DYMO_NextObject() DYMO\RetVar\NextObject = #Null$ If NextElement(DYMO\Objects()) DYMO\RetVar\NextObject = DYMO\Objects() EndIf ProcedureReturn DYMO\RetVar\NextObject EndProcedure ProcedureDLL.s DYMO_GetText(Object.s) DYMO\RetVar\GetText = DYMO\COM\Labels\GetStringProperty("GetText('" + Object + "')") ProcedureReturn DYMO\RetVar\GetText EndProcedure ProcedureDLL DYMO_SetAddress(Address.s, Index = 1) ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("SetAddress(" + Str(Index) + ",'" + Address + "')") EndProcedure ProcedureDLL DYMO_SetField(Object.s, Text.s) ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("SetField('" + Object + "','" + Text + "')") EndProcedure ProcedureDLL DYMO_GetAddressFieldCount() ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("AddressFieldCount()") EndProcedure ProcedureDLL DYMO_SetAddressPOSTNET(POSTNET_Pos.s, Index = 1) DYMO\COM\Labels\Invoke("POSTNET(" + Str(Index) + ",'" + POSTNET_Pos + "')") EndProcedure ProcedureDLL DYMO_SetImageFile(Object.s, File.s) ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("SetImageFile('" + Object + "','" + File + "')") EndProcedure ProcedureDLL DYMO_SetImageURL(Object.s, URL.s) ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("SetImageURL('" + Object + "','" + URL + "',#NUllString)") EndProcedure ProcedureDLL DYMO_PasteFromClipboard(Object.s) ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("PasteFromClipboard('" + Object + "')") EndProcedure ProcedureDLL DYMO_PasteImageFromClipboard(Object.s) ProcedureReturn DYMO\COM\Labels\GetIntegerProperty("PasteImageFromClipboard('" + Object + "')") EndProcedure Procedure INTERNAL_DYMO_Variant2Buffer(*Var.VARIANT) Protected Size, *Ret = #Null, *SafeArray.SAFEARRAY If *Var And *Var\vt = #VT_ARRAY|#VT_UI1 And *Var\parray *SafeArray = *Var\parray Size = *SafeArray\rgsabound[0]\cElements - *SafeArray\rgsabound[0]\lLbound If Size *Ret = AllocateMemory(Size) If *Ret If SafeArrayLock_(*SafeArray) = #S_OK CopyMemory(*SafeArray\pvData, *Ret, Size) SafeArrayUnlock_(*SafeArray) Else FreeMemory(*Ret) *Ret = #Null EndIf EndIf EndIf EndIf ProcedureReturn *Ret EndProcedure Procedure INTERNAL_DYMO_Buffer2Variant(*Buffer, BufferSize) Protected *SafeArray.SAFEARRAY, SafeArrayBound.SAFEARRAYBOUND Protected *Ret_Variant.VARIANT = AllocateStructure(VARIANT) If *Ret_Variant And *Buffer And BufferSize > 0 VariantClear_(*Ret_Variant) SafeArrayBound\lLbound = 0 SafeArrayBound\cElements = BufferSize *SafeArray = SafeArrayCreate_(#VT_UI1, 1, SafeArrayBound) If *SafeArray If SafeArrayLock_(*SafeArray) = #S_OK CopyMemory(*Buffer, *SafeArray\pvData, BufferSize) *Ret_Variant\vt = #VT_ARRAY|#VT_UI1 *Ret_Variant\parray = *SafeArray SafeArrayUnlock_(*SafeArray) EndIf EndIf EndIf ProcedureReturn *Ret_Variant EndProcedure DisableExplicit ; CursorPosition = 1 ; Folding = AAAAAAAA- ; EnableXP ; CompileSourceDirectory ; EnableCompileCount = 0 ; EnableBuildCount = 0 ; EnableExeConstant ; EnableUnicode