Macro to Query SharePoint Site for Existing Pages Content Type

  • Thread starter Thread starter girlgeek101
  • Start date Start date
G

girlgeek101

I would like to enter a SharePoint URL in cell A1, and use a macro to
retrieve a list of Content Types = 'basic page' (with it's keywords column)
found under that URL. Has anyone seen anything like that - or can you point
me to where I might find that?

Thank you for your help in advance.
 
I have lots of VBA macros that open an IE explorer window and download data
from a URL. Is the sharepoint a webpage or a database? If you can provied a
URL that would help.

It seem like yyou have some sort of table. Webpages have multiple tables
and it is sometimes tricky in identify the correct table. What soemtimes
help is to perform a webquery to identify the corect table. You can use the
worksheet menu

Data - Import External Data - Import Data - New Webquery.

Yo can even record a macro while performing the operation to get a macro
that may help. Here is a simple macro that uses the IE explorer.

Sub GetZipCodes()


ZIPCODE = InputBox("Enter 5 digit zipcode : ")

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

URL = "http://zip4.usps.com/zip4/citytown_zip.jsp"

'get web page
IE.Navigate2 URL
Do While IE.readyState <> 4 And _
IE.busy = True

DoEvents
Loop

Set Form = IE.document.getElementsByTagname("Form")

Set zip5 = IE.document.getElementById("zip5")
zip5.Value = ZIPCODE


Set ZipCodebutton = Form(0).onsubmit

Form(0).submit
Do While IE.busy = True
DoEvents
Loop

Set Table = IE.document.getElementsByTagname("Table")
Location = Table(0).Rows(2).innertext
IE.Quit
MsgBox ("Zip code = " & ZIPCODE & " City/State = " & Location)


End Sub
 
Back
Top