Mar 20, 2007 18:09
Anyone know how to make a macro that will copy a directory from one area of a server to another and rename it? We are creating a new file structure at work and we want to create a master template folder which using a macro we just enter the name and it copies the template to the Projects directory under the pre-defined name?
Is this possible?
Leave a comment
Comments 5
Reply
Reply
Sub copy()
' create variables
Dim message, title, defaultvalue As String
' messagebox prompt message
message = "Enter filename"
' messagebox prompt title
title = "Filecopy"
' messagebox prompt default value
defaultvalue = "Enter filename here"
' pop up input box
myValue = InputBox(message, title, defaultvalue, 100, 100)
' create destination string
Dim destination As String
destination = "c:\temp\test\" & myValue
' copy files
FileCopy "c:\temp\a.tmp", destination
End Sub
Reply
Reply
It probably depends on what version of VB you're using and it's not really my strong point I'm afraid.
Reply
Leave a comment