Results 1 to 2 of 2

Thread: Word VBA SharePoint API to Populate Combobox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2016
    Posts
    23
    Location

    Red face Word VBA SharePoint API to Populate Combobox

    Hi, can anyone help with the required VBA code to get data via api then loop through the data to return just the Name field. The API string as /_api/Web/GetFolderByServerRelativeUrl('Shared%20Documents/General/NewFolder')?$expand=Folders&$FilterField=Name essentially looks for he Folder names in a SharePoint Document Library Folder and I would like to just return the d:Name field (or Folder name) into a Combobox in a Word Userform.

    Sample code returned but looking to populate only the entry as d:Name as highlighted below:

    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xml:base="https://fumble.sharepoint.com/sites/Review/_api/">
    <id>
    https://fumble.sharepoint.com/sites/.../Review/Shared Documents/General/NewFolder')
    </id>
    <category term="SP.Folder" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
    <link rel="edit" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Files" type="application/atom+xml;type=feed" title="Files" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')/Files"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListItemAllFields" type="application/atom+xml;type=entry" title="ListItemAllFields" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')/ListItemAllFields"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentFolder" type="application/atom+xml;type=entry" title="ParentFolder" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')/ParentFolder"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Properties" type="application/atom+xml;type=entry" title="Properties" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')/Properties"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/StorageMetrics" type="application/atom+xml;type=entry" title="StorageMetrics" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')/StorageMetrics"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folders" type="application/atom+xml;type=feed" title="Folders" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder')/Folders">
    <m:inline>
    <feed>
    <id>f9543195-g475-30t5-ab3j-17e5c2f38e9d</id>
    <title/>
    <updated>2020-04-17T10:22:52Z</updated>
    <entry>
    <id>
    https://fumble.sharepoint.com/sites/.../Review/Shared Documents/General/NewFolder/Folder1')
    </id>
    <category term="SP.Folder" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
    <link rel="edit" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Files" type="application/atom+xml;type=feed" title="Files" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')/Files"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListItemAllFields" type="application/atom+xml;type=entry" title="ListItemAllFields" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')/ListItemAllFields"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentFolder" type="application/atom+xml;type=entry" title="ParentFolder" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')/ParentFolder"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Properties" type="application/atom+xml;type=entry" title="Properties" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')/Properties"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/StorageMetrics" type="application/atom+xml;type=entry" title="StorageMetrics" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')/StorageMetrics"/>
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folders" type="application/atom+xml;type=feed" title="Folders" href="Web/GetFolderByServerRelativePath(decodedurl='/sites/Review/Shared%20Documents/General/NewFolder/Folder1')/Folders"/>
    <title/>
    <updated>2020-04-17T10:22:52Z</updated>
    <author>
    <name/>
    </author>
    <content type="application/xml">
    <mroperties>
    <d:Exists m="Edm.Boolean">true</d:Exists>
    <d:IsWOPIEnabled m="Edm.Boolean">false</d:IsWOPIEnabled>
    <d:ItemCount m="Edm.Int32">2</d:ItemCount>
    <d:Name>Folder1</d:Name>
    <d:ProgID m:null="true"/>
    <d:ServerRelativeUrl>
    /sites/Review/Shared Documents/General/NewFolder/Folder1
    </d:ServerRelativeUrl>
    <d:TimeCreated m="Edm.DateTime">2019-10-02T10:42:28Z</d:TimeCreated>
    <d:TimeLastModified m="Edm.DateTime">2019-10-02T10:42:42Z</d:TimeLastModified>
    <d:UniqueId m="Edm.Guid">12c15367-70941-5c6g-82c5-010ec4a77gg3</d:UniqueId>
    <d:WelcomePage/>
    </mroperties>
    </content>
    </entry>
    Last edited by AndreaM; 04-17-2020 at 05:13 AM. Reason: Adding further information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •