Function GetProfileString(section, key, filename) If fso.FileExists(filename) Then Dim readini, bsection bsection = False Set readini = fso.OpenTextFile(filename, 1) Do While Not (readini.AtEndOfStream) Dim strini, trimstrini strini = readini.ReadLine trimstrini = MyTrim(strini) If Left(trimstrini, 1) = "[" And Right(trimstrini, 1) = "]" Then If StrComp(trimstrini, "[" & MyTrim(section) & "]", 1) = 0 Then bsection = True Else bsection = False End If Else If bsection Then Dim poskey poskey = InStr(trimstrini, "=") If poskey > 0 Then If StrComp(MyTrim(Left(trimstrini, poskey - 1)), MyTrim(key), 1) = 0 Then GetProfileString = MyTrim(Mid(trimstrini, poskey + 1)) Exit Function End If End If End If End If Loop End If GetProfileString = "" End Function