用这个函数
这样用:
strTemp=Extract("EqualizerVisible=TRUE","=",1)
'strTemp="TRUE"
然后就一行一行读吧
Public Function Extract(Text As String, strSeparator As String, ByVal Index As Long) As String
Dim strColl As New VBA.Collection
Dim lngStart As Long 'the first place finding begin
Dim lngLoc As Long 'the position of ","
Dim lngLocPrev As Long
Dim blnEnd As Boolean
blnEnd = False
lngStart = 1
lngLocPrev = 0
Do While Not blnEnd
lngLoc = VBA.InStr(lngStart, Text, strSeparator)
If lngLoc <> 0 Then
If (lngLoc <> lngStart) Then
strColl.Add VBA.Mid(Text, lngStart, lngLoc - lngStart)
End If
'springxie modified here (12/16/2002),to suit for the Seperator text which length > 1,such as "OF"
'lngStart = lngLoc + 1
lngStart = lngLoc + VBA.Len(VBA.Trim(strSeparator))
Else
strColl.Add VBA.Mid(Text, lngStart)
blnEnd = True
End If
Loop
If (0 <= Index) And (Index < strColl.count) Then
Extract = VBA.Trim(strColl.Item(Index + 1))
Else
Extract = ""
End If
Set strColl = Nothing
End Function
这样用:
strTemp=Extract("EqualizerVisible=TRUE","=",1)
'strTemp="TRUE"
然后就一行一行读吧
Public Function Extract(Text As String, strSeparator As String, ByVal Index As Long) As String
Dim strColl As New VBA.Collection
Dim lngStart As Long 'the first place finding begin
Dim lngLoc As Long 'the position of ","
Dim lngLocPrev As Long
Dim blnEnd As Boolean
blnEnd = False
lngStart = 1
lngLocPrev = 0
Do While Not blnEnd
lngLoc = VBA.InStr(lngStart, Text, strSeparator)
If lngLoc <> 0 Then
If (lngLoc <> lngStart) Then
strColl.Add VBA.Mid(Text, lngStart, lngLoc - lngStart)
End If
'springxie modified here (12/16/2002),to suit for the Seperator text which length > 1,such as "OF"
'lngStart = lngLoc + 1
lngStart = lngLoc + VBA.Len(VBA.Trim(strSeparator))
Else
strColl.Add VBA.Mid(Text, lngStart)
blnEnd = True
End If
Loop
If (0 <= Index) And (Index < strColl.count) Then
Extract = VBA.Trim(strColl.Item(Index + 1))
Else
Extract = ""
End If
Set strColl = Nothing
End Function
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货