1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| 'Lit toutes les clés d'une section
Public Sub ReadKey(ByVal strINIFileName As String, ByVal strSection As String, aKey() As String)
Dim strReturn As String
On Error GoTo ErrReadKey
strReturn = String(8192, 0)
GetPrivateProfileSection strSection, strReturn, 8192, strINIFileName
aKey = Split(Left(strReturn, InStr(1, strReturn, vbNullChar & vbNullChar) - 1), vbNullChar)
ExitReadKey:
Exit Sub
ErrReadKey:
MsgBox "Impossible de lire les clés du fichier INI.", _
vbCritical + vbOKOnly, ctAppName
Resume ExitReadKey
End Sub |
Partager