Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function CopyFile(ByVal strSourcePath As String, strName As String, strTargetPath As String)
' Procedure :   CopyFile
' Description:  Make a copy of the source file in the target directory.
' Copyright:    Chris Greaves Inc.
' Inputs:       STRING Path and name of the source file, target directory.
' Returns:      None.
' Assumes:      None.
' Side Effects: None.
' Tested:       By the calls below
    If Right$(strSourcePath, 1) <> Application.PathSeparator Then
        strSourcePath = strSourcePath & Application.PathSeparator
    Else
    End If
    If boolFileExists(strSourcePath & strName) Then
        If boolFileExists(strTargetPath & strName) Then
            If UCase(strGPA(strcOverWrite, strcOverWriteDefault)) = "Y" Then
                FileCopy strSourcePath & strName, strTargetPath & strName
            Else
                If MsgBox("Do you want me to overwrite this file: " & strTargetPath & strName, vbYesNo) = vbYes Then
                    FileCopy strSourcePath & strName, strTargetPath & strName
                Else
                End If
            End If
        Else
            FileCopy strSourcePath & strName, strTargetPath & strName
        End If
    Else
        Call LogFile(strcApplication, "I could not find this file: " & strSourcePath & strName)
    End If
'Sub TESTCopyFile()
'Call CopyFile("d:\greaves\products\indxr\", "indxr.zip", "c:\temp\")
'Call CopyFile("d:\greaves\products\indxr", "indxr.zip", "c:\temp\")
'Call CopyFile("d:\greaves\products\indxr", "in\dxr.zip", "c:\temp\")
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function CopyFile(ByVal strSourcePath As String, strName As String, strTargetPath As String)
' Procedure :   CopyFile
' Description:  Make a copy of the source file in the target directory.
' Copyright:    Chris Greaves Inc.
' Inputs:       STRING Path and name of the source file, target directory.
' Returns:      None.
' Assumes:      None.
' Side Effects: None.
' Tested:       By the calls below
    If Right$(strSourcePath, 1) <> Application.PathSeparator Then
        strSourcePath = strSourcePath & Application.PathSeparator
    Else
    End If
    If boolFileExists(strSourcePath & strName) Then
        If boolFileExists(strTargetPath & strName) Then
            If UCase(strGPA(strcOverWrite, strcOverWriteDefault)) = "Y" Then
                FileCopy strSourcePath & strName, strTargetPath & strName
            Else
                If MsgBox("Do you want me to overwrite this file: " & strTargetPath & strName, vbYesNo) = vbYes Then
                    FileCopy strSourcePath & strName, strTargetPath & strName
                Else
                End If
            End If
        Else
            FileCopy strSourcePath & strName, strTargetPath & strName
        End If
    Else
        Call LogFile(strcApplication, "I could not find this file: " & strSourcePath & strName)
    End If
'Sub TESTCopyFile()
'Call CopyFile("d:\greaves\products\indxr\", "indxr.zip", "c:\temp\")
'Call CopyFile("d:\greaves\products\indxr", "indxr.zip", "c:\temp\")
'Call CopyFile("d:\greaves\products\indxr", "in\dxr.zip", "c:\temp\")
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1