WSS Forum

Ask Question   UnAnswered
Home » Forum » WSS       RSS Feeds

Check file exists in Sharepoint list from VBA

  Asked By: John    Date: Feb 08    Category: WSS    Views: 11868

I am using Word 2007 VBA to compile a Word document from multiple documents stored in a WSS3 document library. The problem that I have encountered and trawling the web over the last 24 hours suggests others have had the same problem is that I want to check if the file exists in the list and if not report this to the user.


If file exists in sharepoint list
Then import into word document
Else MsgBox 'File does not exist in list'

I have tried something like:

InsertFileName = "http://server/listname/filename.docx"
If Not FSO.FileExists(InsertFileName) Then
MsgBox (InsertFileName & " was not found")
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdSectionBreakOddPage
Selection.InsertFile (InsertFileName)
End If

but this always reports that the document does not exist.

Is there anyone out there with some word vba and sharepoint experience that can help me with this one?



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Check file exists in Sharepoint list from VBA Or get search suggestion and latest updates.