Insert Unicode character into word 2003 macro

Soldato
Joined
28 Dec 2003
Posts
3,767
Location
Aberwristwatch
I am trying to rewrite a macro due to a change of font and insert a 'w' and a 'y' with accents on them.

Here's the code. The 'ŵ' and 'ŷ' come out as '??' at the bottom of the code. Is it possible to paste Unicode into macros? The 'ã' and 'ñ' characters we remapped in the old font to w and y. We are now changing back to Times New Roman.

WordBasic.Insert "ã"
Case "y"
WordBasic.Insert "ñ"
Case "W"
WordBasic.Insert "Ã"
Case "Y"
WordBasic.Insert "Ñ"
Case Else
Rem
End Select
End Sub

??​

This probably makes no sense and will try and reword it as replies come in

Cheers
 
Quoted from another website
"Just a comment: No need for Hex2Dec. VBA "understands" hex literals. You enter them with the &H prefix, i.e.

.Value = ChrW(&H06DE)"


Amended code

Case "w"
WordBasic.Insert ChrW(x175)
Case "y"
WordBasic.Insert "ñ"
Case "W"
WordBasic.Insert "Ã"
Case "Y"
WordBasic.Insert "Ñ"​

This code puts in a star. Anyone know the hex code for LATIN SMALL LETTER W WITH CIRCUMFLEX' (U+0175)
 
Back
Top Bottom