|
-
February 17th, 2008, 05:32 PM
#1
Starting a function after invalid path is found
Hey there guys, just a quick question here. I have an application that is reading a path from a text file and I want it to perform a task when the path is seen as valid and performing another task when the path is found as invalid. So far I have made do with this:
If txtPath.text = "" Then
MsgBox "The path you have set is invalid"
Else
MsgBox "You have a valid path"
End If
now you can easily point out the problem here, this is just a silly little example but it shows that all I am saying is that if the text box is blank, nothing will happen, otherwise if something is there then my app will do something I want it to.
So my question is; how do I tell my app to actually see if the path I have written in is valid and performs a particular task if the path is found to be invalid. Also, I would like to go one step further with this. Say for example I want my application to only work when a certain file type is written in the text box for the path (eg; C:\app\document.doc). I also want to be able to prevent the application from crashing when loading a fake or invalid .doc file (just incase someone tries to pass off a jpeg as a doc file or something.
Hope that all makes sense up there 
Thanks guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|