VB宏基本案例(2)
Sub getAllPic()
bmpFileType = ".bmp"
pngFileType = ".png"
pathA = "G:\GB18030-36x36HeiBMP(Unicode)\"
pathB = "D:\GY_150_FONT\"
'ネ。オテヨミホトラヨオトUnicodeユメオスマ犹リヘシニャ。」
Dim strPicName, strA, tmpStr, tmpStr1 As String
Sheets("resutle").Select
strA = Range("C" & 2).Value
For i = 1 To Len(strA)
tmpStr = Left(Mid(strA, i, Len(strA)), 1)
'strPicName = get_Unicode(tmpStr)
strPicName = GetGBKCode(tmpStr)
fm = (strPicName) & bmpFileType
flName = strPicName & bmpFileType
Set fs = Application.FileSearch
With fs
.LookIn = pathA
.Filename = fm
If .Execute() > 0 Then
Shell "cmd.exe /c copy " & pathA & flName & " " & pathB & flName
Else
tmpStr1 = tmpStr1 & " " & tmpStr
Range("B2 ") = tmpStr1 & " ホトシイサエ贇レ。」"
End If
End With
Next i
End Sub

浙公网安备 33010602011771号