Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Using VBA trying to find text that is also a URL wiithin a body of text. I assume the URl is astyle or something like a style that could be searched for but haven't dscovered the method or property, anyone know what to use?

    Thank you

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try searching the VBA help for "hyperlink" to give yourself a start. HTH
    Gre

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Quote Originally Posted by Jim Bassett View Post
    Using VBA trying to find text that is also a URL wiithin a body of text. I assume the URl is astyle or something like a style that could be searched for but haven't dscovered the method or property, anyone know what to use?

    Thank you
    Hi Jim,

    Try something along the lines of:
    Code:
    Sub Find_URLs()
    ' Macro by macropod
    With Selection.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Text = "htt[ps]{1,2}:^47^47[^32-^127]{3,}"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchAllWordForms = False
      .MatchSoundsLike = False
      .MatchWildcards = True
      .Execute
    End With
    End Sub
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you both for the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •