What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Need VB help(Visual Basic)

Need VB help(Visual Basic)
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Need VB help(Visual Basic)
I sure hope you understand this
Checks if a folder exists on the drive
code:
Private Sub Form_Load()
    DoesFolderExist "C:\My Test Folder", True
End Sub

Public Function
DoesFolderExist(strPath As String, Optional blnCreateFolder As Boolean = False) As Boolean
On Error GoTo e:
    ChDir strPath
    DoesFolderExist = True
    Exit Function

e:
    If blnCreateFolder = True Then
        MkDir strPath
    End If
    DoesFolderExist = False
End Function

Checks if a file exists and it not creates it
code:
Private Sub Form_Load()
    DoesFileExist "C:\My Test Folder\test.txt", True
End Sub

Public Function
DoesFileExist(strFile As String, Optional blnCreateFile As Boolean = False) As Boolean
On Error GoTo
e:
    FileLen (strFile)
    DoesFileExist = True
    Exit Function

e:
    If blnCreateFile = True Then
        Open
strFile For Append As #1
        Close #1
    End If
    DoesFileExist = False
End Function


This post was edited on 08-25-2005 at 01:14 AM by matty.
08-25-2005 01:07 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 07:26 AM
RE: Need VB help(Visual Basic) - by segosa on 08-22-2005 at 07:33 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 07:34 AM
RE: Need VB help(Visual Basic) - by Dempsey on 08-22-2005 at 07:43 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 07:48 AM
RE: Need VB help(Visual Basic) - by Dempsey on 08-22-2005 at 07:50 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 07:55 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 08:26 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 08:30 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 08:36 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 08:39 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 08:47 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 09:13 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 09:22 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 09:24 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 09:33 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-22-2005 at 09:48 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 10:01 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 10:10 AM
RE: Need VB help(Visual Basic) - by CookieRevised on 08-22-2005 at 11:05 AM
RE: Need VB help(Visual Basic) - by spokes on 08-22-2005 at 11:13 AM
RE: Need VB help(Visual Basic) - by CookieRevised on 08-22-2005 at 11:44 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-25-2005 at 12:49 AM
RE: Need VB help(Visual Basic) - by matty on 08-25-2005 at 01:07 AM
RE: Need VB help(Visual Basic) - by CookieRevised on 08-25-2005 at 03:49 AM
RE: Need VB help(Visual Basic) - by dylan! on 08-25-2005 at 10:50 PM
RE: Need VB help(Visual Basic) - by CookieRevised on 08-25-2005 at 11:53 PM
RE: Need VB help(Visual Basic) - by dylan! on 09-11-2005 at 08:18 AM
RE: Need VB help(Visual Basic) - by spokes on 09-11-2005 at 08:32 AM
RE: Need VB help(Visual Basic) - by dylan! on 09-11-2005 at 09:03 AM
RE: Need VB help(Visual Basic) - by segosa on 09-11-2005 at 10:12 AM
RE: Need VB help(Visual Basic) - by ShawnZ on 09-11-2005 at 10:15 AM
RE: Need VB help(Visual Basic) - by mad_onion on 09-11-2005 at 09:01 PM
RE: RE: Need VB help(Visual Basic) - by segosa on 09-12-2005 at 06:48 AM
RE: Need VB help(Visual Basic) - by prashker on 09-11-2005 at 09:38 PM
RE: Need VB help(Visual Basic) - by mad_onion on 09-12-2005 at 06:15 PM
RE: RE: Need VB help(Visual Basic) - by CookieRevised on 09-14-2005 at 03:53 AM
RE: Need VB help(Visual Basic) - by dylan! on 10-09-2005 at 05:57 AM
RE: Need VB help(Visual Basic) - by CookieRevised on 10-09-2005 at 01:14 PM
RE: Need VB help(Visual Basic) - by dylan! on 10-09-2005 at 10:36 PM
RE: Need VB help(Visual Basic) - by Ezra on 10-09-2005 at 11:17 PM
RE: Need VB help(Visual Basic) - by dylan! on 10-09-2005 at 11:24 PM
RE: Need VB help(Visual Basic) - by surfichris on 10-09-2005 at 11:50 PM
RE: Need VB help(Visual Basic) - by dylan! on 10-09-2005 at 11:53 PM
RE: Need VB help(Visual Basic) - by CookieRevised on 10-10-2005 at 12:13 AM
RE: Need VB help(Visual Basic) - by dylan! on 10-10-2005 at 07:07 PM
RE: Need VB help(Visual Basic) - by Ezra on 10-10-2005 at 07:31 PM
RE: Need VB help(Visual Basic) - by dylan! on 10-22-2005 at 05:49 AM
RE: Need VB help(Visual Basic) - by CookieRevised on 10-22-2005 at 02:05 PM
RE: Need VB help(Visual Basic) - by ShawnZ on 10-22-2005 at 02:53 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On