Solved

Copy a File From SharePoint

Posted on 2013-05-27
5
575 Views
Last Modified: 2013-05-30
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
Comment
Question by:EMCIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Bill Ross
ID: 39199897
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
 
LVL 6

Expert Comment

by:Sushanta Sahu
ID: 39200290
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
 
LVL 11

Author Comment

by:EMCIT
ID: 39201316
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
 
LVL 14

Accepted Solution

by:
Bill Ross earned 500 total points
ID: 39202974
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
 
LVL 11

Author Closing Comment

by:EMCIT
ID: 39207517
Thanks. Works perfectly!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 - Check if date format = "MM/DD/YYYY' and check if date also exist 23 75
access vba 5 52
Want my table columns to autofit. 7 55
SQL Server 2012 to SQL Server 2016 24 52
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question