Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Program a Button to Copy a file

Status
Not open for further replies.

JPower

MIS
Apr 19, 2001
1
US
Does anyone know how I can program a button on a E-Mail to copy a file from a network drive to a local drive when clicked? I know how to create the button, but I don't know the code to preform this function. Thanks for any help.
 
Use the FileCopy Lotus script function

The syntax is:
FileCopy sourcefile, destinationfile

Warning: If the destinationfile already exists, it will be overwritten.
You can use the DIR function to check for this- Dir(filepath&name) will return a null string ("") if the file does not exists.

Here's an example that shows both:
Code:
Sub Click(Source As Button)
     If Dir("C:\Test.txt") = "" Then
          Filecopy "C:\windows\desktop\Test.txt","C:\Test.txt"
     Else
          Messagebox "Cannot copy- Destination file already exists."
     End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top