Précédent   Forum des professionnels en informatique > Logiciels > Microsoft Office > Access > Contribuez
Contribuez Access : Vos contributions. Postez ici vos codes sources, conseils, astuces et autres propositions. Ce forum n'est pas un forum technique mais destiné aux contributions pour www.developpez.com
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 20/08/2007, 15h18   #1
Expert Confirmé Sénior

 
Avatar de cafeine
 
Inscription : juin 2002
Messages : 3 882
Détails du profil
Informations forums :
Inscription : juin 2002
Messages : 3 882
Points : 4 500
Points : 4 500
Par défaut [Texte] convertir un OEM en ANSI

Hello,

Voici comment convertir un OEM en ANSI

Code :
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
Code :
1
2
?OEMtoANSI ("21/09/2006  11:29            3ÿ875ÿ328 1028-Loyers siŠge fin 08.xls")
21/09/2006  11:29            3 875 328 1028-Loyers siège fin 08.xls
Ou bien sur un fichier
Code :
?OEMtoANSI ("C:\Temp\Dir.txt", False)
__________________
Ne mettez pas "Problème" dans vos titres, par définition derrière toute question se cache un problème

Développez une application de gestion des comptes bancaires dans Access de A à Z
Déjà 12 tutoriels, le dernier en date : Comment faire un TextBox auto-extensible dans un formulaire ?


cafeine est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 09h09.


 
 
 
 
Partenaires

Hébergement Web