proba con esta funcion....
'Codigo de Barras Interleaved 2 of 5 Public Function I2of5(DataToEncode As String) As String ' ' Copyright © IDautomation.com, Inc. 2001. All rights reserved. ' For more info visit http://www.BizFonts.com ' ' You may use our source code in your applications only if you are using barcode fonts created by IDautomation.com, Inc. ' and you do not remove the copyright notices in the source code. ' DataToPrint = "" DataToEncode = RTrim(LTrim(DataToEncode)) ' Check to make sure data is numeric and remove dashes, etc. OnlyCorrectData = "" StringLength = Len(DataToEncode) For I = 1 To StringLength 'Add all numbers to OnlyCorrectData string If IsNumeric(Mid(DataToEncode, I, 1)) Then OnlyCorrectData = OnlyCorrectData & Mid(DataToEncode, I, 1) Next I DataToEncode = OnlyCorrectData 'Check for an even number of digits, add 0 if not even If (Len(DataToEncode) Mod 2) = 1 Then DataToEncode = "0" & DataToEncode 'Assign start and stop codes StartCode = ChrW(203) StopCode = ChrW(204) StringLength = Len(DataToEncode) For I = 1 To StringLength Step 2 'Get the value of each number pair CurrentCharNum = val((Mid(DataToEncode, I, 2))) 'Get the AscWII value of CurrentChar according to chart by to the value If CurrentCharNum < 94 Then DataToPrint = DataToPrint & ChrW(CurrentCharNum + 33) If CurrentCharNum > 93 Then DataToPrint = DataToPrint & ChrW(CurrentCharNum + 103) Next I 'Get Printable String Printable_string = StartCode + DataToPrint + StopCode & " " 'Return PrintableString I2of5 = Printable_string End Function
