0

I have been tasked to find all the documents in a 2010 SharePoint site. I also need to identify the "Modified By and Date" of each document. I am using 2010 Access and coding in VBA. I have tired using the GetListItems with RecursiveAll query. First go around the nodes provided a parcel list of documents and folders at the first level. I tried using the GetListItems with RecursiveAll query on the folders to obtain their documents but failed. The routine did not like the URL and ID of each folder. The following is the code I have tried, supplying the envelop a ID and the Call a URL.

ListName = "{D220F782-6D73-4DEE-B462-75FA253CF379}"

my_envelope = "<?xml version=""1.0"" encoding=""utf-8""?>" & _
          "<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-  instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""   xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">" & _
          "<soap12:Body>" & _
          "<GetListItems xmlns=""http://schemas.microsoft.com/sharepoint/soap/"">" & _
            "<listName>" & ListName & "</listName>" & _
            "<viewName></viewName>" & _
            "<query></query>" & _
            "<viewFields></viewFields>" & _
            "<rowLimit></rowLimit>" & _
            "<QueryOptions>" & _
            "<IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns>" & _
            "<ViewAttributes Scope=""RecursiveAll""/>" & _
            "<DateInUtc>TRUE</DateInUtc>" & _
            "</QueryOptions>" & _
            "<webID></webID>" & _
          "</GetListItems>" & _
          "</soap12:Body>" & _
          "</soap12:Envelope>"

Call XMLhttp.Open("POST", Site_Url, False, userid, password)

Any help would be greatly appreciated on how to get all the documents in a 2010 Sharepoint site with (Modified By and Date).

Erik A
  • 31,639
  • 12
  • 42
  • 67
Bob K.
  • 1
  • 2
  • You want to find documents in a "site", but then limit the search to a single "list"?. The best solution would be to use the built-in advanced search function. Much faster because it uses the indexer. See this Microsoft tutorial: [Quickly find the resources you need](https://support.office.com/en-us/article/Quickly-find-the-resources-you-need-to-get-your-job-done-2783e97f-07f0-41e7-a738-32cf206833e2). Yet, if you really want the pain of doing this in VBA using SOAP calls then try [Search Protocol - Query](https://msdn.microsoft.com/en-us/library/dd964227%28v=office.12%29.aspx). – Yogi Mar 11 '16 at 18:41
  • Roberto thanks for the feedback. Yes I have used the build-in advanced search function in SharePoint. But I have over 100 SharePoint sites I need to search on a weekly basis. That is why I need to use VBA. Thanks for the link to the Search Protocol - Query, very helpful. I am able to get properties like title, path, etc using the following - "<Property name='title'/>" or "<Property name = 'title'/>". But how do I get Write which is a Date/Time and not text, see https://msdn.microsoft.com/en-us/library/dd964316(v=office.12).aspx. Any thoughts? – Bob K. Mar 16 '16 at 14:30
  • Web service usually return dates in ISO-8601 format. See [Parsing an ISO8601 date/time](http://stackoverflow.com/questions/4896116/parsing-an-iso8601-date-time-including-timezone-in-excel) for converting to VBA date. If you move to SP2013 then consider using the [REST search](https://msdn.microsoft.com/en-us/library/office/jj163876.aspx). There is even a nice VBA interface for it [here](https://github.com/VBA-tools/VBA-Web). – Yogi Mar 16 '16 at 23:52

0 Answers0