andysuth
08-02-2007, 02:40 AM
I'm after a nice, neat, quick way of copying one file name to a file variant name.
Currently I'm using this:
Sub filecopier(verint As Integer)
Dim VFF As Long, vBody As String, filein As String, fileout As String
fileout = pathstring & verint & filestring & extension
filein = pathstring & 1001 & filestring & extension
' MsgBox ("copiedfile" & fileout)
VFF = FreeFile
Open filein For Binary As #VFF
vBody = Space$(LOF(VFF))
Get #VFF, , vBody
Close #VFF
Open fileout For Output As #VFF
Print #VFF, vBody
Close #VFF
End Sub
because I tried to use this:
Shell "copy " & pathstring & 1001 & filestring & extention & " " & pathstring & versionint & filestring & extention, vbMaximizedFocus
but it didn't like it.
All variables are plugged in before hand and the filenames check out when I do a msgbox with them in, it just doesn't like it.
The "Shell" method seems neater, but alas doesn't work.
Any clues?
Cheers!
-AS
Currently I'm using this:
Sub filecopier(verint As Integer)
Dim VFF As Long, vBody As String, filein As String, fileout As String
fileout = pathstring & verint & filestring & extension
filein = pathstring & 1001 & filestring & extension
' MsgBox ("copiedfile" & fileout)
VFF = FreeFile
Open filein For Binary As #VFF
vBody = Space$(LOF(VFF))
Get #VFF, , vBody
Close #VFF
Open fileout For Output As #VFF
Print #VFF, vBody
Close #VFF
End Sub
because I tried to use this:
Shell "copy " & pathstring & 1001 & filestring & extention & " " & pathstring & versionint & filestring & extention, vbMaximizedFocus
but it didn't like it.
All variables are plugged in before hand and the filenames check out when I do a msgbox with them in, it just doesn't like it.
The "Shell" method seems neater, but alas doesn't work.
Any clues?
Cheers!
-AS