View Single Post
 
Old 12-14-2014, 09:29 AM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi,

it took quite some time, but at least I got it (hope so):

Code:
Function GetHValUnicode(ByVal sSource) As String
Dim sVal As String, i As Long

    sSource = Left(Trim(sSource), 2)
    For i = 1 To 2
        sVal = sVal & DecodeAscW(Mid$(sSource, i, 1))
        If i = 1 Then sVal = sVal & "|"
    Next
    GetHValUnicode = sVal

End Function

Function DecodeAscW(sChar)
Dim sAscVal As Long

    sAscVal = AscW(sChar)
    If sAscVal < 0 Then sAscVal = sAscVal + 65536
    DecodeAscW = sAscVal
    
End Function

Sub InsertOrSearchSegoeOISymbol()
Dim vNew As Variant, sSearch As String

    vNew = Split(GetHValUnicode(Selection), "|")
    ' type character
    Selection.InsertAfter ChrW(vNew(0)) & ChrW(vNew(1))
    ' create string for S&R
    sSearch = "ChrW(" & vNew(0) & ") & ChrW(" & vNew(1) & ")"

End Sub
Cheers
NP
Reply With Quote