Consulting

Results 1 to 3 of 3

Thread: Replace hyperlink with the text it points to

  1. #1

    Replace hyperlink with the text it points to

    I have a Word file with hundreds of hyperlinks to small sections of formatted texts in various other (rather large) Word files. These formatted text sections are bookmarked in their respective Word files (that's where the hyperlinks point to).

    I need to replace each hyperlink with the formatted text it points to, i.e. not with the name of the bookmark, but with the corresponding text.

    Practically, the user - instead of having to click on the hyperlink to see the relevant text - will see the text itself in the main document.

    I have no experience with VBA, so I am hoping that someone has a ready VBA macro that does the job.

    Thank you for any help.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You can do this via Find/Replace - no code required.

    1. Press Alt-F9 to toggle Word's field code display 'on'
    2. Use a wildcard Find/Replace, where:
    Find = HYPERLINK ("*")*("*")
    Replace = INCLUDETEXT \1 \2
    3. Press Alt-F9 to toggle Word's field code display 'off'
    4. Press Ctrl-A, F9
    Done.

    Note: The content is still linked to the source, so changing it there will result in the destination content updating also. If you don't want that, you can break the links.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Hi Paul,
    Thank you so much. It certainly did the trick.

Tags for this Thread

Posting Permissions

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