vbscript 检测QQ邮箱和雅虎中国邮箱

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript 检测QQ邮箱和雅虎中国邮箱相关的知识,希望对你有一定的参考价值。

Sub existQQYahoo()
  Dim myrange As New myrange
  Dim frontRange As Range
  Set frontRange = myrange.frontPart
   frontRange.Select
   If InStr(Selection.Text, "@qq") > 0 Then
        Selection.HomeKey wdStory
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "@qq"
            .MatchWildcards = False
            .Replacement.Text = ""
            Do
            .Execute
                If Not .Found Then
                    Exit Do
                Else
                    Selection.Range.HighlightColorIndex = wdRed
                End If
            Loop
        End With
   End If
   
      If InStr(Selection.Text, "@yahoo") > 0 Then
        Selection.HomeKey wdStory
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "@yahoo"
            .MatchWildcards = False
            .Replacement.Text = ""
            Do
            .Execute
                If Not .Found Then
                    Exit Do
                Else
                    Selection.Range.HighlightColorIndex = wdRed
                End If
            Loop
        End With
   End If
End Sub

以上是关于vbscript 检测QQ邮箱和雅虎中国邮箱的主要内容,如果未能解决你的问题,请参考以下文章