导出用户列表到Excel的几种方法
2014-01-14 16:11
357 查看
最近客户在咨询着怎么把SharePoint上面的用户列表给到出Excel,查看了一下,SharePoint并没有提供直接可用的导出功能(虽然都是List,但就是不让你导出。。。)
网上搜索了一下,方法多种多样,按需而用吧。
方法一:
1. 打开你要导出的SharePoint Group页面。
2. 复制该页面URL。
3. 打开Excel > Data > From Web,然后将上一步复制的URL粘贴过去,然后点击GO。
你会看到页面上有很多黄色箭头,选择User Group的表格,然后点击import。
方法二:
1. 打开People and Groups页面。
2. 选择Settings > List Settings。
3. 选择View > List View。
4. 选择想要导出的field。
5. 从该页面的URL复制List和View的ID。
6. 用复制的ID替换下面URL的[LISTID]和[VIEWID],然后浏览器打开它。
URL Format: {Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={List GUID}&View={View GUID}&CacheControl=1
方法三:
编写VBA调用SharePoint的Web Service导出用户列表到XML
网上搜索了一下,方法多种多样,按需而用吧。
方法一:
1. 打开你要导出的SharePoint Group页面。
2. 复制该页面URL。
3. 打开Excel > Data > From Web,然后将上一步复制的URL粘贴过去,然后点击GO。
你会看到页面上有很多黄色箭头,选择User Group的表格,然后点击import。
方法二:
1. 打开People and Groups页面。
2. 选择Settings > List Settings。
3. 选择View > List View。
4. 选择想要导出的field。
5. 从该页面的URL复制List和View的ID。
6. 用复制的ID替换下面URL的[LISTID]和[VIEWID],然后浏览器打开它。
URL Format: {Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={List GUID}&View={View GUID}&CacheControl=1
方法三:
编写VBA调用SharePoint的Web Service导出用户列表到XML
Function GetUserGroups(userName As String,webUrl As String) Dim soapClient As MSXML2.XMLHTTP Set soapClient = New MSXML2.XMLHTTP Dim xmlDoc As MSXML2.DOMDocument Set xmlDoc = New MSXML2.DOMDocument 'Creating SOAP Envelope Dim body As String body = "<?xml version=""1.0"" encoding=""utf-8""?>" & _ "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _ "<soap:Body>" & _ "<GetGroupCollectionFromUser xmlns=""http://schemas.microsoft.com/sharepoint/soap/directory/"">" & _ "<userLoginName>" & userName & "</userLoginName>" & _ "</GetGroupCollectionFromUser >" & _ "</soap:Body>" & _ "</soap:Envelope>" 'Load it in an xml document xmlDoc.LoadXML body 'Open HTTP port soapClient.Open "POST", webUrl & "_vti_bin//usergroup.asmx", False 'Send soap envelope via HTTP soapClient.send xmlDoc 'Parse result to retreive groups Dim strGroups As String strGroups = "" If soapClient.readyState = 4 Then If soapClient.Status = 200 Then Dim grp As IXMLDOMNode For Each grp In soapClient.responseXML.getElementsByTagName("Group") Debug.Print (grp.XML) Dim attr As IXMLDOMAttribute For Each attr In grp.Attributes If attr.Name = "Name" Then If strGroups <> "" Then strGroups = strGroups & ";" End If strGroups = strGroups & attr.Value End If Next Next Else Debug.Print XMLHttpReq.Status & ", " & XMLHttpReq.responseText End If End If GetUserGroups = strGroups End Function
相关文章推荐
- datagrid数据导出到excel文件给客户端下载的几种方法(转)
- C#导出EXCEL的几种方法
- datagrid数据导出到excel文件给客户端下载的几种方法
- OEL导出excel文件时候,美化excel的几种方法
- SQL SERVER使用OpenRowset,、OpenDataSource函数导入、导出数据到Excel 的几种方法(整理)
- 总结一下最近一段时间导出数据到Excel的几种方法
- datagrid数据导出到excel文件给客户端下载的几种方法
- 转:datagrid数据导出到excel文件给客户端下载的几种方法
- 由DataSet导出生成excel的几种方法
- 导出数据到Excel的几种方法
- 用户列表Excel导出实例(POI)
- 对.NET中导出数据到EXCEL的几种方法探讨
- datagrid数据导出到excel文件给客户端下载的几种方法
- asp中把数据导出为excel的几种方法
- 对.NET中导出数据到EXCEL的几种方法探讨 C1TrueDBGrid
- datagrid数据导出到excel文件给客户端下载的几种方法
- OEL导出excel文件时候,美化excel的几种方法
- C#导出EXCEL的几种方法
- datagrid数据导出到excel文件给客户端下载的几种方法
- QT将TableWidget 导出为excel的几种方法