private function ChangeFont(yourStr as string ) as string dim i as integer dim mChr as string dim KeyAscii as long for i=1 to len(yourstr) keyascii=asc(mid(yourstr,i,1)) If AscW(Chr(KeyAscii)) > 32 Then '轉全角 KeyAscii = Asc(ChrW(AscW(Chr(KeyAscii)) - 288)) mChr =mchr & Chr(KeyAscii) ElseIf AscW(Chr(KeyAscii)) = 32 Then mChr =mchr & ChrW(12288) else mchr=mchr & mid(yourstr,i,1) End If next changefont=mchr end function
dim i as integer
dim mChr as string
dim KeyAscii as long
for i=1 to len(yourstr)
keyascii=asc(mid(yourstr,i,1))
If AscW(Chr(KeyAscii)) > 32 Then '轉全角
KeyAscii = Asc(ChrW(AscW(Chr(KeyAscii)) - 288))
mChr =mchr & Chr(KeyAscii)
ElseIf AscW(Chr(KeyAscii)) = 32 Then
mChr =mchr & ChrW(12288)
else
mchr=mchr & mid(yourstr,i,1)
End If
next
changefont=mchr
end function