Hyperlink display text

Anonymous
2022-11-23T20:30:38+00:00

When I toggle field codes on a hyperlink, I see only the target URL. For example, if I have some text "Click here to see examples" and I set the link to https://www.example.com/docs/2.0.0/examples/, I see "Click here to see examples" in the document, but when I toggle the field code I see { HYPERLINK "https://www.example.com/docs/2.0.0/examples/" }. How is the display text managed? I'm looking for something in the HYPERLINK field code so I can dynamically change the display text.

Microsoft 365 and Office | Word | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Anonymous
    2022-11-24T16:59:11+00:00

    If it were just me, I'd happily do it in VBA, but I have to document a procedure for people who don't understand macros well enough to know what to enable and where in the options, and I have to share the files widely, often via email, through virus filters that reject any document with VBA.

    0 comments No comments
  2. Anonymous
    2022-11-24T17:01:15+00:00

    That's ultimately what I will have to do. That's inconsistent, though. If I'm editing a hyperlink manually, and the text and the underlying link are identical, the changes I make to the display text are automatically updated in the link. I was hoping that the search and replace functionality would use the same logic, but apparently not.

    0 comments No comments
  3. Stefan Blom 325K Reputation points MVP Volunteer Moderator
    2022-11-24T17:34:55+00:00

    That's ultimately what I will have to do. That's inconsistent, though. If I'm editing a hyperlink manually, and the text and the underlying link are identical, the changes I make to the display text are automatically updated in the link. I was hoping that the search and replace functionality would use the same logic, but apparently not.

    In the Hyperlink dialog box (Ctrl+K), modifying the hyperlink address will reflect in the display text, if you haven't specified a display text that is different from the URL.

    But the converse is not true: if you edit a URL in the display text, the link address will not update. At least that is the case here, tested in Word 2021, version 2210, running under Windows 11.

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2022-11-24T18:30:10+00:00

    All underlying hyperlinks verified by hovering over them.

    1. Type https://www.example.com/, press ENTER. Hyperlink created.
    2. Manually change "www" to "app", use cursor to move out of link, underlying hyperlink updated.
    3. Press Ctrl-H, find "app", replace with "www", click "Replace All". Display text updated, underlying hyperlink not updated.
    4. Press Ctrl-Z to undo. Display text restored.
    5. Move to hyperlink, press Shift-F9 to reveal the field code.
    6. Manually change "app" to "www". Press Shift-F9 to hide the field code. Display text not updated.
    7. Press Shift-F9 to reveal the field code. Press Ctrl-Z to undo until "app" is restored.
    8. Press Ctrl-H, find "app", replace with "www", click "Replace All". Press Shift-F9 to hide the field code. Display text not updated.

    Same version of Word as you.

    My problem here is that Word is smart enough in step 2 to recognize that the display text and the hyperlink are the same and to apply the edit to both. It doesn't do the same in step 3. At the very least, it's inconsistent behaviour and a bad user experience. In my opinion, steps 6 and 8 are also problematic, for the same reason.

    1 person found this answer helpful.
    0 comments No comments
  5. Stefan Blom 325K Reputation points MVP Volunteer Moderator
    2022-11-24T18:59:17+00:00

    All underlying hyperlinks verified by hovering over them.

    1. Type https://www.example.com/, press ENTER. Hyperlink created.
    2. Manually change "www" to "app", use cursor to move out of link, underlying hyperlink updated.
    3. Press Ctrl-H, find "app", replace with "www", click "Replace All". Display text updated, underlying hyperlink not updated.
    4. Press Ctrl-Z to undo. Display text restored.
    5. Move to hyperlink, press Shift-F9 to reveal the field code.
    6. Manually change "app" to "www". Press Shift-F9 to hide the field code. Display text not updated.
    7. Press Shift-F9 to reveal the field code. Press Ctrl-Z to undo until "app" is restored.
    8. Press Ctrl-H, find "app", replace with "www", click "Replace All". Press Shift-F9 to hide the field code. Display text not updated.

    Same version of Word as you.

    My problem here is that Word is smart enough in step 2 to recognize that the display text and the hyperlink are the same and to apply the edit to both. It doesn't do the same in step 3. At the very least, it's inconsistent behaviour and a bad user experience. In my opinion, steps 6 and 8 are also problematic, for the same reason.

    Thanks for the follow-up. I realize that we are referring to slightly different things. :-)

    I was referring to the Hyperlink dialog box, where the behavior is the way I described it.

    When editing a URL in the body of the document, Word's automatic conversion of URLs into hyperlink comes into play. That is the situation you are describing.

    1 person found this answer helpful.
    0 comments No comments