Function GetValue(pSource As String, strValueName As String) As String
Dim arrLines As Variant, _
varLine As Variant, _
arrFields As Variant
arrLines = Split(pSource, vbCrLf)
For Each varLine In arrLines
If InStr(1, varLine, "=") Then
arrFields = Split(varLine, "=")
If InStr(1, arrFields(0), strValueName) Then
GetValue = Trim(arrFields(1))
Exit For
End If
End If
Next
End Function
|