Public Function Azalea_Code39FullASCII(ByVal Code39 As String) As String ' C39Tools 31dec06 jwhiting ' Copyright 2006 Azalea Software, Inc. All rights reserved. www.azalea.com ' The standard Code 39 character set is: A-Z (upppercase), 0-9, $ % + - . / and the space character. ' Code 39 Full ASCII barcodes encode the lower 128 ASCII characters by using pairs of characters ' to represent input outside the standard 44 character set version of Code 39. Dim i As Integer ' loop counter Dim chunk As String ' loop variable Dim temp As String ' temp variable ' map the input into the Full ASCII version of Code 39 For i = 1 To Len(Code39) chunk = Mid(Code39, i, 1) Select Case Asc(chunk) Case 0 temp = temp + "%U" Case 1 To 26 temp = temp + "$" + Chr(Asc(chunk) + 64) Case 27 To 31 temp = temp + "%" + Chr(Asc(chunk) + 38) Case 32 ' Because TrueType doesn't support glyphs in the space slot (ASCII 32) ' we've moved the space character to the underscore ( _ ). ' Here's the search and replace. temp = temp + "_" Case 33 To 44 temp = temp + "/" + Chr(Asc(chunk) + 32) Case 45 To 46 temp = temp + chunk Case 47 temp = temp + "/O" Case 48 To 57 temp = temp + chunk Case 58 temp = temp + "/Z" Case 59 To 63 temp = temp + "%" + Chr(Asc(chunk) + 11) Case 64 temp = temp + "%V" Case 65 To 90 temp = temp + chunk Case 91 To 95 temp = temp + "%" + Chr(Asc(chunk) - 16) Case 96 temp = temp + "%W" Case 97 To 122 temp = temp + "+" + Chr(Asc(chunk) - 32) Case 123 To 126 temp = temp + "%" + Chr(Asc(chunk) - 43) Case 127 temp = temp + "%T" End Select Next i ' Add the start and stop bars before and after the modified input string. AzaleaSoftware_Code39FullASCII = "*" + temp + "*" ' The output, AzaleaSoftware_Code39FullASCII, is formatted using one of Azalea Software's Code 39 fonts. ' For example, B1=AzaleaSoftware_Code39FullASCII(A1) ' Or put another way, yourContainer.text=AzaleaSoftware_Code39FullASCII(yourInputString) End Function