Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

Copy a File From SharePoint

I am using a MS Access application that I need to copy a file from SharePoint and paste a copy to the local machine but I can't get the right format for the path. Any assistance is appreciated.
0
EMCIT
Asked:
EMCIT
  • 2
  • 2
1 Solution
 
Bill RossCommented:
Hi,

Find the file in SharePoint, right click on the file, click Copy Link Address.  Paste into a document.  That's the document's path (URL).

Regards,

Bill
0
 
Sushanta SahuPrincipal Specialist, Information ManagementCommented:
You may want to use the explorer view to open the document library as a normal file share. And then copy the file as if you are copying a normal file in windows and then paste it to your local drive.

Please note, opening the SharePoint document library will take few seconds and the copy paste will also take few seconds more as compared to normal copy paste operations in windows.

Let me know how it goes.
0
 
EMCITAuthor Commented:
This is the code I am using in the On Load Event of the form "LaunchForm":

Me.TheUser = Environ("username")

Dim sDest As String
Dim sSource As String

sSource = "http:\\SPAddress.SPAddress.com\HomePage\SiteName\Documents\Launch.accdb"
sDest = "C:\Documents and Settings\" & [Forms]![LaunchForm]![TheUser] & "\Desktop\NewFileName.mdb"

FileCopy sSource, sDest

Dim appAccess As Access.Application
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase "C:\Documents and Settings\" & [Forms]![LaunchForm]![TheUser] & "\Desktop\NewFileName.mdb"

The problem seems to be with the "http" address. I get a Run-Time Error '52'. Bad file name or number at the FileCopy sSource line. The sSource file, stored in SP, is the file I need to make a copy of.
0
 
Bill RossCommented:
Hi,

What version of Access?  I think FileCopy requires a path/URL.

Try removing the https:

sSource = "\\SPAddress.SPAddress.com\HomePage\SiteName\Documents\Launch.accdb"

Bill
0
 
EMCITAuthor Commented:
Thanks. Works perfectly!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now