WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

AskFileName Alternative


A more versatile AskFilename Dialog.
;This requires...C:\WINNT\system32\Comdlg32.ocx

; Get file to manipulate
CDObj = CreateObject("MSComDlg.CommonDialog")
CDObj.MaxFileSize = 260 ; Init buffer (NECESSARY!)
CDObj.Flags = 4 ; File Must Exist + no ReadOnly checkbox
CDObj.Filter = "All Files (*.*)|*.*|Winbatch Files (*.wbt)|*.wbt"
;CDObj.Filter = "Winbatch Files (*.wbt)|*.wbt"
CDObj.InitDir = dirscript()

CDObj.DialogTitle = "RPC Select File"

CDObj.ShowOpen()
;
fname = CDObj.filename
; Cancel or no file name?
If fname <> "" 
	Message( "The file you chose is " , fname)
else
	message("Debug", "You hit Cancel")
End if
CDObj = 0


Reference:

http://msdn.microsoft.com/library/en-us/cmdlg98/html/vbobjcommondialog.asp?frame=true

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/html/vbproFlagsFile.asp


Article ID:   W17190
File Created: 2007:07:03:14:28:40
Last Updated: 2007:07:03:14:28:40