ADD Balance - trademark of Charles Kenyon, Attorney at Law and Webmaster. Frequently Asked Questions - Help
Microsoft Word - Frequently Asked Questions - click to go to the question list.

on ADD Balance by Madison Wisconsin Criminal Defense Lawyer Charles Kenyon

Many people visit this site and use the information it contains. It costs money to keep on line and effort to update.
If you have received assistance here
please consider making a donation if you can.

 
Thank you. Charles Kenyon

Thank you for the suggestions. ("Smilies" from Woody's Lounge.) Click to go to Lounge. with input and suggestions from many on Thank you for the suggestions. ("Smilies" from Woody's Lounge.) Click to go to Lounge.
the Microsoft Newsgroups and at Woody's Lounge 

Click here to skip past FAQ questions list and other info and go directly to the start of this topic.

Search the FAQ site on Google.

Remember to Refresh your page. [F5].

 

 

 

Introduction

Questions

 Click to open a new browser window at Amazon.com.

This index page last revised: 06 Jan 2024 23:47:34 -0500 .

 

Using a single-click checkbox in Microsoft Word without a protected form

The simplest way to do this is using the Add-In on this site. Otherwise, you will be essentially reconstructing it in your own system, possibly your normal.dot or normal.dotm template.

In Word 2010 and later, you can use checkbox content controls. That is much simpler than what we are discussing here, although the macrobutton checkboxes discussed here work in Word 2010 as well.

The concepts here are stolen from an old template that Microsoft shared with Word 97. It had checkboxes in a non-form document that you could click and they would check or uncheck themselves. It turned out that those checkboxes were in fact macrobutton fields. Further, they were stored as AutoText in the template.

By design, when you click on a macrobutton field it selects the entire field including its displayed content, in this case an empty or checked box. The macro which is run, replaces that field with another macrobutton field, in this case a checked or unchecked box. These fields are stored as AutoText entries.

The default for a macrobutton field is to run the named macro when it is double-clicked. If you have told Word to do so, you can run them from a single click. This requires a separate line of vba which must be run before you try to use the macrobutton.

I have prepared a simple Add-In that you can put in your Word Startup Folder to use these. It has the AutoText as well as the code. If you want to use this effect in your own forms without installing the Add-In, you will need to copy the AutoText entries from the Add-In template to your template along with the code. You could certainly write your own AutoText and code as well.

For a simple document template here is code written for Word 97 that works today (2016).

-----------------------

Option Explicit 
Sub AutoNew()
 AutoOpen ' so new document responds the same as opened document 
End Sub 
Sub AutoOpen()
 Options.ButtonFieldClicks = 1
 Selection.HomeKey Unit:=wdStory
 Selection.NextField.Select 
End Sub 
Sub Check()
 ActiveDocument.AttachedTemplate.AutoTextEntries("Checked Box").Insert _
   Where:=Selection.Range
End Sub 
Sub Uncheck()
 ActiveDocument.AttachedTemplate.AutoTextEntries("Unchecked Box").Insert _
   Where:=Selection.Range 
End Sub 

The AutoText entries are the macrobutton fields.

bulletUnchecked Box AutoText: { Macrobutton Check }
bulletChecked Box AutoText: { Macrobutton Uncheck }

An alternative - Greg Maxey's Macros and Add-Ins

Greg Maxey has a very nice page on this at http://gregmaxey.com/word_tip_pages/add_interactive_toggle_objects_to_document.html.

Greg Maxey's Toggle Add-In - single-click checkboxes

 

 

 

 

Send e-mail

Changes / suggestions / ideas can be sent to Charles Kenyon.

In Association with Amazon.com

 

This page viewed Hit Counter times since 14 April 2004.

Many people visit this site and use the information it contains.
It costs money to keep on line and effort to update.
If you have received assistance here
please consider making a donation if you can.

 
Thank you. ckk

Copyright 2000-2024 Charles Kyle Kenyon

FAQ provided as an adjunct / hobby as a part of my web site as a criminal defense lawyer.

Smile! Bumper stickers and jokes.

Click to return to table of contents page of Intermediate User's Guide to Microsoft Word.Click to go to Microsoft Word new users frequently asked questions site in a new browser window.
(Intermediate Users' Guide) - - - - - - - - - - - - - - - - - - -  (Questions List)