This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//the form.js functions don't play well in IE9 mode | |
//lets override and fix them | |
//console.log("loading form.ie9fix.js"); | |
function RTE_GetEditorInstanceVariables(strBaseElementID) | |
{ULS1Lu:; | |
if (parent.g_oExtendedRichTextSupport !=null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name SharePoint Dev Tools | |
// @namespace TiagoDuarte | |
// @description Adds new buttons near the ribbon for typical SharePoint actions | |
// @version 3.7 | |
// @grant none | |
// @match https://*.sharepoint.com/* | |
// ==/UserScript== | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
#provide the path for the input xml document | |
$xmlPath = "C:\temp\tiles-list-elements.xml", | |
#embed xml (for demo purposes) | |
$xmlContent = ' | |
<Data> | |
<Rows> | |
<Row> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
SharePoint document lock release script | |
Tiago Duarte | |
Based on code from Peter Holpar, | |
https://pholpar.wordpress.com/2014/04/07/how-to-use-javascript-to-delete-short-term-locks-from-documents-opened-from-sharepoint/ | |
Page URL: | |
/Pages/UnlockFile.aspx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPList list = web.Lists[txtListTitle.Text]; | |
SPListItem item = list.GetItemById(int.Parse(txtItemID.Text)); | |
SPFile file = item.File; | |
if (file.LockType == SPFile.SPLockType.None) | |
{ | |
txtOutput.Text = "File is not locked"; | |
} | |
else | |
{ | |
int lockUserID = file.LockedByUser.ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
$webUrl = "http://demosite", | |
$listTitle = "testlib", | |
$itemID = 183 | |
) | |
clear-host | |
$web = Get-SPWeb $webUrl | |
$list = $web.Lists[$listTitle] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dlls in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15 | |
using Microsoft.Office.Interop.Word; | |
using Microsoft.Office.Core; | |
Application wordApp = null; | |
try | |
{ | |
//open a new word process | |
wordApp = new Application(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="locked-doc"> | |
<p> | |
<label>Document URL</label> | |
<br/> | |
<input id="docUrl" type="text" value="http://" style="width:500px" /> | |
</p> | |
<p> | |
<label>Website URL</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#params | |
$username = "admin@contoso.onmicrosoft.com" | |
$password = "myPWD" | |
$url = "https://contoso.sharepoint.com" | |
$adminUrl = "https://contoso-admin.sharepoint.com" | |
$spd = 0#0-deny disabled; 1-deny enabled | |
#connect to SPO | |
$securePassword = ConvertTo-SecureString $password -AsPlainText -force | |
$credential = New-Object System.Management.Automation.PsCredential($username, $securePassword) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check if page is in edit mode through page form mode | |
if (Microsoft.SharePoint.SPContext.Current.FormContext.FormMode == SPControlMode.Display) | |
{ | |
// your code to support display mode | |
} | |
else if(Microsoft.SharePoint.SPContext.Current.FormContext.FormMode = SPControlMode.Edit) | |
{ | |
// your code to support edit mode | |
} |
NewerOlder