Una consulta…

Según entiendo esta función te devuelve un string con la codificación de los
datos, pero necesitarías la fuente que represente esta cadena en formato de
barras. 

Hago este comentario porque me tocó renegar con este tema y me resultó
imposible encontrar una fuente interleave 2de5 gratuita que se me muestre
los códigos correctamente.

Entonces mi consulta es acerca de cómo se implementaría esta función para
obtener como salida el código generado

Saludos.

Gastón

  _____  

De: [email protected] [mailto:[EMAIL PROTECTED] En nombre de Ezequiel
Namios
Enviado el: Martes, 10 de Abril de 2007 15:40
Para: vbusers List Member
CC: vbusers List Member
Asunto: [vbusers] Cod de barras Interleave2of5

 


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

Responder a