返回列表 上一主題 發帖

[發問]office 2010 word 範本不能使用Application.FileSearch

[發問]office 2010 word 範本不能使用Application.FileSearch

本帖最後由 awlk 於 2011-11-23 14:50 編輯

請個位大大,這原本是在office 2003 寫的巨集,目前因改成office 2010,所以不能跑了,不知道有那位好心的高手能幫幫小弟修改一下,感恩~~~~~~


Private Sub CommandButtonOK_Click()

Dim PicturePath$
Dim Msg, Style, Title, CR

CR = Chr$(13)
PicturePath$ = ChoosePathForm.TextBox1.Value
   
    With Application.FileSearch
        .NewSearch
        .LookIn = PicturePath$
        .SearchSubFolders = False
        .FileName = "*.jpg"
        .MatchTextExactly = True
        .FileType = msoFileTypeAllFiles

        If .Execute() > 0 Then
            Call Load_the_Pictures(PicturePath$)
        Else
            Msg = "There are no pictures in this directory:" _
                   + CR + CR + PicturePath$ + CR + CR + _
                   "Please check the path again."
            Style = vbOKOnly + vbQuestion
            Title = "No files found"
            MsgBox Msg, Style, Title
        End If
    End With
End Sub

        靜思自在 : 地上種了菜,就不易長草;心中有善,就不易生惡。
返回列表 上一主題