C
Charles Kenyon
I've been trying to figure out a code equivalent to the use of AutoText
entries in inserting checkbox macrobutton fields. A key problem is how to
test for what the current character is before switching it.
The following code ...
Sub Test()
Dim myASCII As String
myASCII = Asc(Selection.Text)
MsgBox myASCII
End Sub
.... reports a value of 40 for both a checked an an unchecked box.
The following code will insert a checked box:
Sub Test2()
Selection.Range.Font.Name = "Wingdings"
Selection.Range.Text = Chr$(254)
End Sub
The number for the unchecked box is 168.
Both of these are decimal codes from the Wingdings font.
I don't know of unicode symbols that will insert equivalent symbols, nor can
I figure out how to test for a Wingdings font code.
Any thoughts would be appreciated.
Once I get this, I have to code to insert the macrobuttons with that text.
Looking forward to it!
TIA
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
entries in inserting checkbox macrobutton fields. A key problem is how to
test for what the current character is before switching it.
The following code ...
Sub Test()
Dim myASCII As String
myASCII = Asc(Selection.Text)
MsgBox myASCII
End Sub
.... reports a value of 40 for both a checked an an unchecked box.
The following code will insert a checked box:
Sub Test2()
Selection.Range.Font.Name = "Wingdings"
Selection.Range.Text = Chr$(254)
End Sub
The number for the unchecked box is 168.
Both of these are decimal codes from the Wingdings font.
I don't know of unicode symbols that will insert equivalent symbols, nor can
I figure out how to test for a Wingdings font code.
Any thoughts would be appreciated.
Once I get this, I have to code to insert the macrobuttons with that text.
Looking forward to it!
TIA
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.