濮阳杆衣贸易有限公司

主頁 > 知識(shí)庫 > vbs選擇文件夾效果代碼

vbs選擇文件夾效果代碼

熱門標(biāo)簽:天津智能外呼系統(tǒng)排名 龍巖400電話申請 企業(yè)400電話辦理價(jià)錢低 智云億呼電話機(jī)器人 外呼系統(tǒng)說話聲音小怎么辦 上海辦理400電話選號(hào) 外呼系統(tǒng)群 機(jī)器人打電銷適用于美業(yè)嗎 墨西哥地圖標(biāo)注app
不用組件的話有兩種辦法: 

set objFile = CreateObject("SAFRCFileDlg.FileOpen") 
Set objShell = CreateObject("Shell.Application") 

本blog里都有示例。 

如果調(diào)用vb組件,可以是: 

flag = h200 
whichone = OpenFile("Choose a File!", "C:\", "Everything|*.*|TextFiles|*.TXT|Word-Documents|*.DOC", 2, flag) 
MsgBox "Raw data returned: "  whichone 
' Split up multi selection result: 
' space is used as separator: 
whichone = Split(whichone, " ") 
' field index 0 contains path information: 
path = whichone(0) 
' list all the files: 
' how many files were selected? 
filecount = UBound(whichone) 
if filecount=0 then 
' just one file selected! 
MsgBox "You selected one file: "  whichone(0) 
' check status of Read Only checkbox 
' is bit 1 set or cleared? 
' works only if just one file was selected! 
MsgBox "Returned flag: "  flag 
if (flag and 1) then 
' (flag and 1)>0, transforms to true 
' bit is set! 
MsgBox "ReadOnly selected!" 
else 
MsgBox "ReadOnly not selected!" 
end If 
' check whether selected file is of default type (txt)  
if (flag and 1024) then 
MsgBox "selected file is no txt file!" 
else 
MsgBox "selected file is of default type!" 
end if 
else 
' more than one file selected! 
MsgBox "You selected "  filecount  " files!" 
for x = 1 to UBound(whichone) 
list = list  path  whichone(x)  vbCr 
next 
MsgBox list 
end If 

function OpenFile(title, dir, filter, index, flags) 
set comdlg = CreateObject("MSComDlg.CommonDialog") 
comdlg.filter = filter 
comdlg.FilterIndex = index 
comdlg.Flags = flags 
comdlg.MaxFileSize = 260 
comdlg.CancelError = false 
comdlg.DialogTitle = title 
comdlg.InitDir = dir 
' set txt as default 
comdlg.DefaultExt = "txt" 
comdlg.ShowOpen 
OpenFile = comdlg.filename 
' important: return flag status so your main script can 
' check it: 
flags = comdlg.Flags 
end function 

組件相關(guān)文件下載 http://xiazai.jb51.net/jbtools/vb6controls.rar

標(biāo)簽:青島 齊齊哈爾 黃山 麗水 鄂爾多斯 承德 錫林郭勒盟 阜新

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《vbs選擇文件夾效果代碼》,本文關(guān)鍵詞  vbs,選擇,文件夾,效果,代碼,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《vbs選擇文件夾效果代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于vbs選擇文件夾效果代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    原阳县| 黔南| 丹棱县| 哈尔滨市| 大悟县| 吉安市| 新乡县| 木兰县| 大港区| 吉安县| 安远县| 康平县| 阿图什市| 商城县| 龙胜| 山西省| 衡阳县| 景泰县| 滕州市| 合阳县| 榆中县| 沙湾县| 宜兰市| 客服| 沭阳县| 焦作市| 兰西县| 山东省| 黑龙江省| 浮梁县| 龙江县| 新源县| 菏泽市| 鞍山市| 城固县| 余姚市| 泸州市| 萨嘎县| 阜阳市| 汶上县| 连州市|