Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    May 2003
    Location
    Pennsylvania, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert text to hyperlink (Word 2003)

    I have a file that was exported from an Access report to Word. The hyperlinks in the file are delimited with # signs. How can I convert the delimited text to a hyperlink?

    Thanks for the help.

    DonH.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert text to hyperlink (Word 2003)

    You could run the following macro:

    Sub ConvertHyperlinks()
    Dim strLink As String
    Selection.HomeKey Unit:=wdStory
    With Selection.Find
    .ClearFormatting
    .MatchWildcards = True
    .Text = "#*#"
    .Replacement.ClearFormatting
    .Replacement.Text = ""
    Do While .Execute
    strLink = Mid(Selection, 2, Len(Selection) - 2)
    ActiveDocument.Hyperlinks.Add _
    Selection.Range, strLink, , , strLink
    Loop
    End With
    End Sub

  3. #3
    Star Lounger
    Join Date
    May 2003
    Location
    Pennsylvania, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert text to hyperlink (Word 2003)

    Hans:

    Many thanks. This worked perfectly!

    Don.

Posting Permissions

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