Eu tenho esse código para converter cada letra em um texto de entrada para o novo texto usando a tabela de mapeamento
Attribute VB_Name = "Module1"
Option Compare Database
Function ReplaceLetters(inputText As String) As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Integer
Dim originalChar As String
Dim mappedChar As String
Dim newText As String
' Open the database and the lookup table
Set db = CurrentDb
Set rs = db.OpenRecordset("LetterMapping", dbOpenSnapshot) ' Lookup table name
newText = inputText
' Loop through each letter in the text
For i = 1 To Len(inputText)
originalChar = Mid(inputText, i, 1) ' Get the character at position i
' Look up the replacement in the table
rs.MoveFirst
Do While Not rs.EOF
If rs!OriginalLetter = originalChar Then
mappedChar = rs!MappedLetter
newText = Left(newText, i - 1) & mappedChar & Mid(newText, i + 1)
Exit Do ' Stop searching once found
End If
rs.MoveNext
Loop
Next i
' Close the recordset
rs.Close
Set rs = Nothing
Set db = Nothing
ReplaceLetters = newText
End Function
o código funciona bem, mas algumas letras mudam em uma letra, por exemplo, se eu tiver essas letras no texto de entrada "ÌÍÎ", dê apenas uma letra na letra mapeada, que é a primeira "ج"