Move file in Sharepoint from Access

  • Thread starter Thread starter Kaykayme
  • Start date Start date
K

Kaykayme

I am trying to move files from one folder to another on a Sharepoint drive
from Access. I was successful in exporting the report to a pdf file on the
Sharepoint drive. However, I want to move the old files to an archive folder
before exporting the new files monthly. The error I am running into is when
I use the scripting.filesystemobject move method, the destination path
includes \\ and I get an error message that the run-time error "Method 'Move'
of object 'IF'ile' failed" because of it. Is there some workaround since I
cannot use a mapped drive? I would have to make sure that this drive would
be mapped on every users computer.

Any help would be greatly appreciated.
 
You can try the FileCopy() and Kill() functions to copy the file to a new
location, and then delete the original.


'=======
Dim sFile As String 'original path
Dim sCopy As String 'path of the copy

sFile = "\\SomeFolder\SomeFile.pdf"
sCopy = "\\SomeOtherFolder\SomeFile.pdf"

FileCopy sFile sCopy
DoEvents
Kill sFile
'==========

hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Thanks! That worked!

Jack Leach said:
You can try the FileCopy() and Kill() functions to copy the file to a new
location, and then delete the original.


'=======
Dim sFile As String 'original path
Dim sCopy As String 'path of the copy

sFile = "\\SomeFolder\SomeFile.pdf"
sCopy = "\\SomeOtherFolder\SomeFile.pdf"

FileCopy sFile sCopy
DoEvents
Kill sFile
'==========

hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Back
Top