Function Rutgonchuoi(ByVal SourceString As String, Optional Removemark As Boolean = False) As String
Dim Tmp, i As Byte, Res As String
Tmp = Split(LCase(Trim(SourceString)), " ")
For i = 0 To UBound(Tmp) - 1
Res = Res & Left(Tmp(i), 1)
Next i
Rutgonchuoi = Res & Tmp(UBound(Tmp))
Mid(Rutgonchuoi, 1, 1) = UCase(Mid(Rutgonchuoi, 1, 1))
If Removemark Then
Rutgonchuoi = LatiniseUnicode(Rutgonchuoi)
End If
End Function
Function LatiniseUnicode(ByVal Text As String) As String
Dim CharCode, i As Long
Dim ResText As String, sTmp As String
On Error Resume Next
sTmp = Text
CharCode = Array(7855, 7857, 7859, 7861, 7863, 7845, 7847, 7849, 7851, 7853, 225, _
224, 7843, 227, 7841, 259, 226, 273, 7871, 7873, 7875, 7877, 7879, _
233, 232, 7867, 7869, 7865, 234, 237, 236, 7881, 297, 7883, 7889, _
7891, 7893, 7895, 7897, 7899, 7901, 7903, 7905, 7907, 243, 242, _
7887, 245, 7885, 244, 417, 7913, 7915, 7917, 7919, 7921, 250, _
249, 7911, 361, 7909, 432, 253, 7923, 7927, 7929, 7925)
ResText = "aaaaaaaaaaaaaaaaadeeeeeeeeeeeiiiiiooooooooooooooooouuuuuuuuuuuyyyyy"
For i = 0 To UBound(CharCode)
sTmp = Replace(sTmp, ChrW(CharCode(i)), Mid(ResText, i + 1, 1))
sTmp = Replace(sTmp, UCase(ChrW(CharCode(i))), UCase(Mid(ResText, i + 1, 1)))
Next
LatiniseUnicode = sTmp
End Function