Using this example function
Code:
Public Function ReadProfileSection(ByVal SectionName As String, _
ByVal FileName As String) As String
Const MaxSectionLen As Integer = 6120 'Read Up To 5kB From Section
Dim strSectionData As String * MaxSectionLen 'Define buffer to receive section data
Dim lngApiFnVal As Long
'***********************************************************
' Returns vbNullChar delimited string of KeyNames and
' values within specified section
' else returns empty string
'***********************************************************
lngApiFnVal = GetPrivateProfileSection(SectionName, strSectionData, _
MaxSectionLen, FileName)
If lngApiFnVal Then
ReadProfileSection = Left(strSectionData, _
InStr(strSectionData, vbNullChar + vbNullChar) - 1)
End If
End Function
In your own code do something like
Code:
Dim strText As String, strItem() As String
strText = ReadProfileSection("MYSECTION", "C:\MyFolder\MyApp.Ini")
strItem = Split(strText, vbNullChar)
Trevor
Bookmarks