导出用户列表到Excel的几种方法
最近客户在咨询着怎么把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
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
导出用户列表到Excel的几种方法的更多相关文章
- delphi 导出到excel的7种方法
本文来自 爱好者8888 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/kpc2000/article/details/17066823?utm_source=cop ...
- Delphi 导出数据至Excel的7种方法【转】
一; delphi 快速导出excel uses ComObj,clipbrd; function ToExcel(sfilename:string; ADOQuery:TADOQuery): ...
- Delphi 导出数据至Excel的7种方法
一; delphi 快速导出excel uses ComObj,clipbrd; function ToExcel(sfilename:string; ADOQuery:TADOQuery):bool ...
- .NET导出Excel的四种方法及评测
.NET导出Excel的四种方法及评测 导出Excel是.NET的常见需求,开源社区.市场上,都提供了不少各式各样的Excel操作相关包.本文,我将使用NPOI.EPPlus.OpenXML.Aspo ...
- [转帖].NET导出Excel的四种方法及评测
.NET导出Excel的四种方法及评测 https://www.cnblogs.com/sdflysha/p/20190824-dotnet-excel-compare.html 导出Excel是.N ...
- 【转】asp.net导出数据到Excel的三种方法
来源:http://www.cnblogs.com/lishengpeng1982/archive/2008/04/03/1135490.html 原文出处:http://blog.csdn.net/ ...
- 对.NET中导出数据到EXCEL的几种方法探讨
最近在做一个报表系统的时候,需要把DATASET中的数据导到EXCEL当中,于是在网上找了一遍,发现了好几种方法,本来以为应该差不多,但后来经过一一试用后,发现在性能上真的差别很大,现在就介绍一下,同 ...
- html table表格导出excel的方法 html5 table导出Excel HTML用JS导出Excel的五种方法 html中table导出Excel 前端开发 将table内容导出到excel HTML table导出到Excel中的解决办法 js实现table导出Excel,保留table样式
先上代码 <script type="text/javascript" language="javascript"> var idTmr; ...
- HTML用JS导出Excel的五种方法
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
随机推荐
- 分布式文件系统HDFS体系
系列文件列表: http://os.51cto.com/art/201306/399379.htm 1.介绍 hadoop文件系统(HDFS)是一个运行在普通的硬件之上的分布式文件系统,它和现有的分布 ...
- 【转载】Fragment 全解析(1):那些年踩过的坑
http://www.jianshu.com/p/d9143a92ad94 Fragment系列文章:1.Fragment全解析系列(一):那些年踩过的坑2.Fragment全解析系列(二):正确的使 ...
- Effective Objective-C 2.0 Reading Notes
1. Literal Syntax NSString *someString = @"Effective Objective-C 2.0"; NSNumber *someNumbe ...
- accept函数
accept()函数 系统调用 accept() 会有点古怪的地方的! 你能够想象发生 这种事情:有人从非常远的地方通过一个你在侦听 (listen()) 的port连接 (connect()) 到你 ...
- 将表中数据生成SQL语句
在开发过程中,经常需要我们对表中的数据进行转移,如果在同台机器,可以使用SQL自带的导入数据,但是如果想让所有的数据生成可执行的SQL语句,它的移植性最强了.首先要设计一个存储过程.具体如下: CRE ...
- [Angular2 Router] Using snapshot in Router
In the application, we have heros list, when click each hero, will redirect to hero detail view. Tha ...
- [Angular2 Form] Create and Submit an Angular 2 Form using ngForm
Forms in Angular 2 are essentially wrappers around inputs that group the input values together into ...
- python time模块详解(转)
python 的内嵌time模板翻译及说明 一.简介 time模块提供各种操作时间的函数 说明:一般有两种表示时间的方式: 第一种是时间戳的方式(相对于1970.1.1 00:00 ...
- SQLSERVER备份事务日志的作用
事务日志备份有以下3种类型 (1)纯日志备份:仅包含相隔一段时间的事务日志记录,而不包含任何大容量更改 (2)大容量操作日志备份.包括由大容量操作更改的日志和数据页,不支持时间点恢复 (3)尾日志备份 ...
- Q_INVOKABLE与invokeMethod用法全解
在Qt/Qt Quick宏浅议一文中,我们将介绍Qt中经常使用的几个宏: Q_OBJECT, SIGNAL与SLOT, Q_SIGNALS 与 Q_SLOTS, Q_EMIT ,Q_INVOKABLE ...