<-- Previous || Up || Next -->

Copy Files To Sub Directories Sample Sub
Utilities Class

Private Sub CopyFilesToSubDirectoriesSample()
    Const strFn = "CopyFilesToSubDirectoriesSample"

    Dim strSeparator As String
    strSeparator = InputBox("String separator for directory names: ({Esc} cancels.)", strFn, ";")
    If Len(strSeparator) = 0 Then Exit Sub

    Dim strFromDirectories As String
    strFromDirectories = GetWindowsDirectory + strSeparator + GetSystemDirectory
    strFromDirectories = InputBox("Copy files from directories: ({Esc} cancels.)", strFn, strFromDirectories)
    If Len(strFromDirectories) = 0 Then Exit Sub

    Dim strToDirectory As String
    strToDirectory = GetTempFileName(Null, strFn)
    strToDirectory = InputBox("Top destination directory: (ANY FILE WITH THIS NAME WILL BE DELETED; {Esc} cancels.)", strFn, strToDirectory)
    If Len(strToDirectory) = 0 Then Exit Sub
    If Len(Dir$(strToDirectory)) Then Kill strToDirectory

    MsgBox "This sample subroutine only examines files with Normal attributes; it does NOT examine files which have Hidden and/or System attributes.", vbInformation, strFn
    MsgBox "Return = " & CopyFilesToSubDirectories(est, strFromDirectories, strToDirectory, strSeparator, vbNormal) & " (True means success; False means failure.)", vbInformation, strFn
    Debug.Print est.MessageText
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.