Swapping symbols using a macro button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to make a check box.

The idea is the box symbol is empty, then, when double clicked the symbol swaps to the ticked box symbol.

Is this possible or am i wasting my time?
 
I certainly will be looking for responses on this. But in the meantime, you might (you probably already know this) simply double click the inserted symbol, your box, which will take you back to the Font Style Symbol dialogue box, scroll thro and double click the tick box. Alternatively, why not run a macro that will change it for you. Good Luck.
 
One way to do this is to use a pair of macrobutton fields

{Macrobutton CheckIt [put the wingdings font empty box character here]}
Toggle the display to show just the box then save the field as an Autotext
Entry called Unchecked Box

{Macrobutton UnCheckIt [put the wingdings font ticked box character here]}
Toggle the display to show just the ticked box then save the field as an
Autotext Entry called Checked Box

Add the following macros to the template:

Sub CheckIt()
ActiveDocument.AttachedTemplate.AutoTextEntries("Checked Box").Insert _
Where:=Selection.Range
End Sub
Sub UnCheckIt()
ActiveDocument.AttachedTemplate.AutoTextEntries("Unchecked Box").Insert _
Where:=Selection.Range
End Sub

Double click the field and the field will be replaced with the ticked box
field. Double click again to change it back.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Graham has told you what is required, but you can get this function
readymade in the fax cover sheet templates that ship with Word:

These consist of three components:

1. A MacroButton field that runs one of two macros depending on state.

2. A CheckIt macro and an UncheckIt macro.

3. Checked Box and Unchecked Box AutoText entries (these are just Wingdings
characters that have been saved as AutoText).

When the check box is empty (Unchecked Box is displayed), double-clicking on
the MacroButton runs the CheckIt macro, which substitutes the Checked Box,
and vice versa.

In order to use this type of box in your document, you need to Copy/Paste
the MacroButton field into your document/template, then use Organizer to
copy the macros and AutoText entries to your template (it has to be a
template because documents can't store AutoText entries, but you could copy
them to Normal.dot if you're just creating a document rather than a
template).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Carl Smith said:
I am trying to make a check box.

The idea is the box symbol is empty, then, when double clicked the symbol
swaps to the ticked box symbol.
 
Graham and Suzanne both gave good answers, as always. For a an in-depth
explanation and examples of the method Graham describes, aw well as a
comparison to other methods of getting checkboxes into documents, see
http://www.addbalance.com/word/download.htm#CheckboxAddIn

Regards,
Chad DeMeyer


Carl Smith said:
I am trying to make a check box.

The idea is the box symbol is empty, then, when double clicked the symbol
swaps to the ticked box symbol.
 
Back
Top