V S Rawat
unread,Dec 5, 2017, 6:47:35 AM12/5/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to th
Sub cnvCode_Dec2Hex()
Selection.Text = Hex(Selection.Text)
End Sub
Sub cnvCode_Hex2Dec()
Selection.Text = CDec("&h" & Selection.Text)
End Sub
Write a Decimal code and/ or hex code of a character in ms word.
try for GREEK SMALL LETTER ALPHA
α
decimal 945
hex 03B1
select that one code at a time (it should get highlighted)
go to Menu - Developer - Macro
click on cnvCode_Dec2Hex to convert Decimal to Hex code
click on cnvCode_Hex2Dec to convert Hex Code to Decimal
Your selected code will be replaced, you can press Undo ^Z to bring your
original code back.
What is the use?
in MS Word, if you select any character and press Alt X, it will show
the char code of that char.
This code is in hex.
but if you go to Find box, you need to write only decimal values.
like, in Find box
- you can directly write decimal ascii codes by prefixing them with \,
as \999, like \013 is for carriage return (CR ^p)
- you can write decimal unicode codes by prefixing them with \u, as
\u99999, like \u945 is for above mentioned "alpha".
""""You can't put hex values in Find box."""
So, Word gives hex value by Alt X, but you can't use them in find box,
so you need to quickly convert them to decimal.
Funny? No, irritating indeed.
For that purpose, instead of going to ishida site, these tiniest macros
would come handy.
Thanks.
--
Rawat