|
Public Function picFilter(downCode)'定义一个过滤图片信息的过程 Dim pStart As Long, pStop As Long
Dim pString1 As String, pString2 As String
pString1 = "
pString2 = ">" '分别将两个关键词定义
pStart = InStr(downCode, pString1)'找到第一个图片信息的起始位置
If pStart <> 0 Then '如果代码中有图片信息的话
pStop = InStr(pStart, downCode, pString2) + 1 '从上面找的起始部位开始找到第一个用于结束图片信息的”>”
Do While pStart <> 0 '只要仍旧有图片信息
Mid(downCode, pStart, pStop - pStart) = Space(pStop - pStart) '将代码中的图片信息用空格代替,实现删除效果
pStart = InStr(pStop, downCode, pString1)'重复上面的过程,删除其他的图片信息
If pStart = 0 Then Exit Do '没有图片信息后,退出循环
pStop = InStr(pStart, downCode, pString2, 1) + 1
Loop
picFilter=downCode '将处理过后的代码返回过程函数
End Function |