Search code examples
ms-wordword-2016

How to hyperlink a document property field in word 2016?


Document properties are fields that can be used throughout microsoft word: https://support.office.com/en-us/article/view-or-change-the-properties-for-an-office-file-21d604c2-481e-4379-8e54-1dd4622c6b75

Typically I use these fields throughout my document so changing the document property will change all instances of that field throughout my document. This is great, however, when one of the fields is "Company Email" I not only want the text to change to [email protected] but I would like to have that field hyperlinked to [email protected] so that the user can click it in order to send an email.

Edit: (Info from comments)

I have tried to insert a hyperlink, hit alt-f and embed a docproperty via the instructions from a similar thread: stackoverflow.com/questions/17428891/…. But could not get that to work properly.


Solution

  • The following works for me, in a quick test (you'll need to substitute the name of the Document Property you're using):

    { HYPERLINK "mailto:{ DocProperty Email }" }
    

    When I Ctrl+Click this it creates a new Email to the address.

    For readers unfamiliar with inserting field codes: The wavy bracket pairs must be inserted using Ctrl+F9. Alt+F9 after to switch from field code to field display.