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

posted @ 2012-12-11 16:19  陳さん様  阅读(138)  评论(0)    收藏  举报