Hello,
Voici comment convertir un OEM en ANSI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Declare Function OemToChar Lib "user32" Alias "OemToCharA" (ByVal lpszSrc As String, ByVal lpszDst As String) As Long
Function OEMtoANSI(ByVal str As String, _
Optional ByVal blnIsAString As Boolean = True) As String
Dim Fic As Integer
Dim strBuff As String * 1024
If blnIsAString Then
OEMtoANSI = str
Else
Fic = FreeFile()
Open str For Binary Access Read As #Fic
Do While Not EOF(Fic)
Get #Fic, , strBuff
OEMtoANSI = OEMtoANSI & strBuff
Loop
Reset
End If
OemToChar OEMtoANSI, OEMtoANSI
End Function |
Utilisation
1 2
| ?OEMtoANSI ("21/09/2006 11:29 3ÿ875ÿ328 1028-Loyers sige fin 08.xls")
21/09/2006 11:29 3 875 328 1028-Loyers siège fin 08.xls |
Ou bien sur un fichier
?OEMtoANSI ("C:\Temp\Dir.txt", False)
Partager