濮阳杆衣贸易有限公司

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

vbs選擇文件夾效果代碼

熱門標(biāo)簽:天津智能外呼系統(tǒng)排名 龍巖400電話申請 企業(yè)400電話辦理價錢低 智云億呼電話機器人 外呼系統(tǒng)說話聲音小怎么辦 上海辦理400電話選號 外呼系統(tǒng)群 機器人打電銷適用于美業(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)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《vbs選擇文件夾效果代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于vbs選擇文件夾效果代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    木里| 大邑县| 贵州省| 阳原县| 南宫市| 齐齐哈尔市| 科技| 太保市| 仪陇县| 都匀市| 华容县| 集安市| 化德县| 白玉县| 徐州市| 陆丰市| 林口县| 手游| 廉江市| 灵寿县| 桦川县| 镇雄县| 平陆县| 栖霞市| 汉阴县| 阿克苏市| 利辛县| 澄江县| 大渡口区| 民和| 德格县| 阿克苏市| 澳门| 澎湖县| 拜泉县| 府谷县| 成武县| 黔东| 石台县| 皋兰县| 竹北市|