Checkbox to Input AutoText (or similar)

Anonymous
2018-01-16T21:00:33+00:00

Word 2016.

Will have a series of checkboxes which when clicked, I would like pre-set text in AutoText to be added depending on which boxes are checked. If any of the boxes are not checked, I do not want any of the applicable AutoText displayed.

Checkbox 1  |  Checkbox 4

Checkbox 2  |  Checkbox 5

Checkbox 3  |  Checkbox 6

AutoText1

...

AutoText 2

...

etc.

I'm not sure if AutoText is the best option. I will be saving the document on a network drive with multiple user access as a template which will have restricted editing permissions. If this isn't going to work via AutoText I'm not sure what else to do.

Can someone help me with the coding for this?

Moved from:  Office / Word / Windows other / Office 2016

Microsoft 365 and Office | Word | For home | 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

5 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Jay Freedman 208.6K Reputation points Volunteer Moderator
    2018-01-18T04:44:51+00:00

    Hi Andy,

    I think you need just one more step: Add another check box to the template.

    The macro executes only when the cursor moves out of the check box (that's why it's an "exit" macro). When you have only one form field in the document, there's nowhere for the cursor to go -- it can't go into text that isn't part of a form field -- so it just sits in the Check1 box and never runs the exit macro.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2018-01-18T17:12:56+00:00

    Wow can't believe that's all it took haha.

    Learnt a ton in a short period of time tinkering with the code. Thank you so much Jay.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2018-01-17T17:45:46+00:00

    Edit - I just realized I didn't include one space character in the bookmark. Fixed

    I also realize the need to restrict editing. I have selected 'filling in forms' and 'start enforcing protection' which gives me the functional legacy checkbox.

    Also also realized I failed to save the autotext and that macro within the template. I believe I have this fixed.

    Still not working.


    Thanks Jay, that's hugely helpful.

    I thought I had it sorted based on what you've included above but I can't get it going.

    The document is saved as a .dotm file.

    All properties (ie. checkbox name, bookmark name and autotext name should be in line with the code.

    See the following screenshots of what I'm working with. Any idea what I'm missing?

    https://imgur.com/a/fWGwU

    Was this answer helpful?

    0 comments No comments
  5. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more