使用方法:chkGB("Access中國") 返回:英英英英英英簡簡 Private Function chkGb(strGB As String) As String On Error Resume Next Dim ByteGB() As Byte Dim ByteTemp(1) As Byte Dim leng As Long, idx As Long Dim Offset As Long Dim strResult As String ByteGB = StrConv(strGB, vbFromUnicode) leng = UBound(ByteGB) idx = 0 Do While idx <= leng ByteTemp(0) = ByteGB(idx) ByteTemp(1) = ByteGB(idx + 1) Offset = GBOffset(ByteTemp) If (Offset >= 0) And (Offset <= 8177) Then strResult = strResult & "簡" idx = idx + 2 Else strResult = strResult & "英" idx = idx + 1 End If Loop chkGb = strResult End Function Private Function GBOffset(ChrString() As Byte) As Long Dim Dl, Dh Dl = ChrString(0) Dh = ChrString(1) GBOffset = (Dl - 161) * 94 + (Dh - 161) End Function |
|站長郵箱|小黑屋|手機版|Office中國/Access中國
( 粵ICP備10043721號-1 )
GMT+8, 2025-7-17 00:32 , Processed in 0.075538 second(s), 23 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.