返回列表 上一主題 發帖

[發問] 如何取得已經有的FolderBrowserDialog值

回復 1# z15935712
既然你放到TextBox1,何不從TextBox1取

TOP

回復 4# z15935712
檔案系統的處理可查詢FileSystemObject找到相關資料
底下方式供參考:
  1.   Dim s, oFs, oFile
  2.   
  3.   s=TextBox1.Text
  4.   Set oFs = CreateObject("Scripting.FileSystemObject")
  5.   If oFs.FolderExists(s) Then
  6.     For Each oFile In oFs.GetFolder(s).Files  '所有該資料夾下檔案
  7.       If StrComp(Right(oFile.Path, Len(".xlsx")), ".xlsx") = 0 Then  '如果是.xlsx檔案
  8.         'msgbox oFile.Path
  9.       End If
  10.     Next
  11.   End If
複製代碼

TOP

回復 7# z15935712
你這不是VBA吧...
VB.NET ???
沒有Right函式,你自己應該有能力找VB.NET下的字串函式來用

TOP

        靜思自在 : 生氣,就是拿別人的過錯來懲罰自己。
返回列表 上一主題