bgreenhouse
Technical User
<br> 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. What I have now uses the find and replace code to find symbols, using the ChrW value for the find<br> value, and the ASCII code for the replace. My problem now is how to get a complete listing of the "unicode<br> values" 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 "Characters" & Chr(9) & "UniCode Values"<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.<br> Another problem is that the uncode values generated don't seem to match with lists I got off of the Unicode<br> Consortium site. For instance, the above code generates a value of 176 for the degree sign, while the Unicode<br> Consortium gives 00B0 as the value. This may be a simple conversion that I am not aware of, but my main<br> problem is not knowing how to generate the proper values (proper for word to use) for greek letters.<br><br> Any suggestions?