By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

Check if file exists in Sharepoint

P: 64
Hi there,

can anyone help me for the code to check if a file exists on the sharepoint link
and what object I need to pick up from the reference(if any)

Feb 5 '09 #1
Share this Question
Share on Google+
1 Reply

P: 64
Hi there,

I have found following code trough which I can download the file from sharepoint
but I want to check if the file exists on sharepoint (Dont want to download all the files from sharepoint since I am dealing with 80,000 files)

Any thought

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" ( _
ByVal pCaller As Long, ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Sub DownloadFileFromWeb()
Dim i As Integer

Const strUrl As String = " Data Repository/Lehman Brothers/Commodities/Close-out Documentation/Lehman Final Analysis - US Power.xlsx"
Dim strSavePath As String
Dim returnValue As Long

strSavePath = "c:\Documents and Settings\khamyog\Desktop\Lehman Final Analysis - US Power.xlsx"
returnValue = URLDownloadToFile(0, strUrl, strSavePath, 0, 0)

'MsgBox returnValue
End Sub
Feb 6 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.