Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode Values for Symbols

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
This question sort of ties in with an earlier one on macros. Basically, I am trying to write a macro for Word that will find a predefined bunch of symbols and replace them with their ASCII equivalent.&nbsp;&nbsp;What I have now uses the find and replace code to find symbols, using the ChrW(n) value for the find value, and the ASCII code for the replace. My problem now is how to get a complete listing of the &quot;unicode values&quot; Word uses. I used the code below that I found on the microsoft site to generate unicode values:<br><br>Sub UnicodeGenerator()<br>Dim I As Integer<br>Documents.Add<br>' Set tab stops for clarity.<br>Selection.ParagraphFormat.TabStops.ClearAll<br>ActiveDocument.DefaultTabStop = InchesToPoints(0.5)<br>Selection.ParagraphFormat.TabStops.Add Position:= _<br>InchesToPoints(1.5), Alignment:=wdAlignTabCenter, _<br>Leader:=wdTabLeaderDots<br>' Insert column headings.<br>Selection.InsertAfter &quot;Characters&quot; & Chr(9) & &quot;UniCode Values&quot;<br>Selection.InsertParagraphAfter<br>' Character values below 30 generate undesirable results<br>' when inserted into a document. For example, page breaks<br>' and column breaks.<br>For I = 30 To 255<br>' Insert the character, a tab and the Unicode equivalent.<br>Selection.InsertAfter Chr(I) & Chr(9) & AscW(Chr(I))<br>Selection.InsertParagraphAfter<br>Next<br>End Sub<br><br>The problem with this code is that it doesn't generate unicode values for symbols such as greek letters etc.&nbsp;&nbsp;Another problem is that the uncode values generated don't seem to match with lists I got off of the Unicode Consortium site. For instance, the above code generates a value of 176 for the degree sign, while the Unicode Consortium gives 00B0 as the value. This may be a simple conversion that I am not aware of, but my main problem is not knowing how to generate the proper values (proper for word to use) for greek letters.<br><br>Any suggestions? <br><br>Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top