Link to create new documents in Office Online and OneDrive – WOPIFRAME

You can create hyperlinks to the create new document functionality in office online using the following URL structure and template type parameter:



Excel: Same with TemplateType=2

Powerpoint: Same with TemplateType=3

Onenote: Same with TemplateType=4


The folder/url doesnt have to be pointed at the users onedrive. it could be any folder on any site.


Took a while finding this. Leave  a comment if you found this useful!

Auto provision OneDrive for users – programmatically

By default OneDrive storage is not provisions for users until they click on the OneDrive link at the top navigation bar in Office 365.

This can be a massive pain, especially if they’re using the iPad app which wont provision OneDrive instead it just repeatedly asks them to login! Ouch!

Fortunately there is a way to do this using CSOM. Firstly download the client runtime dlls from ​

After installing, add the version 16 DLLs to a new c# console application in Visual Studio 2013 references from Program files/SharePoint Client Components.

Add the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.UserProfiles;

namespace CreatePersonalSiteBulkConsole
class Program
static void Main(string[] args)
string userName = “”;
string passwordStr = “password”;
string serverUrl = “”;

using (var clientContext = new ClientContext(serverUrl))
SecureString password = new SecureString();
Array.ForEach(passwordStr.ToCharArray(), c => password.AppendChar(c));

var credentials = new SharePointOnlineCredentials(userName, password);

clientContext.Credentials = credentials;

var web = clientContext.Web;
ProfileLoader loader = ProfileLoader.GetProfileLoader(clientContext);

if (loader == null)
throw new InvalidOperationException(“Failed to get ProfileLoader”);

string[] userEmails = { “”, “” };

Yammer web app embed not working in IE

If the yammer embed app is working for you in Chrome and Firefox but not in IE. Then most likely you need to add the following to your IE trusted sites:​


InfoPath Cannot find the specified path for VSTA project

If your using InfoPath 2013 and come across this error when trying to access developer tools, its because this version of VSTA copies the code to a temp folder then then works on it there.

Problem is that temp folder are exactly that… “temp” so if the folder is lost then InfoPath will complain it cant find it.

The way around this is on the developer tab on the ribbon, click ‘Language’, click remove code (dont worry it wont delete your code).

Then click on ‘Code Editor’ again and it will make a new folder for your code in Documents > InfoPath Projects. Overwrite the contents of this new folder with the contents from the original project.

Then in VSTA look at the project properties and you will see the link to the temp folder. Open that folder, overwrite the contents of that also as before.

SharePoint App Permissions

Apps for SharePoint have permissions just as users and groups do. This enables an app to have a set of permissions that are different from the permissions of the user who is executing the app. You must request, in the app manifest file, the permissions that an app needs to run. The user who adds the app must grant these requests, and the user can only grant permissions that he or she has as a user. The grant must be for all the requested permissions or none of them to simplify the management of permissions for users and developers. (The app principal always has full control rights to the app web, so it only needs to request permissions to SharePoint resources in the host web or other locations outside the app web.)

What are Host Webs and App Web

SharePoint 2013 introduces the concept of ‘host webs’ and ‘app webs’.

Apps are deployed to the App Web.

Apps are installed to the Host Web.


What are App Webs

In SharePoint 2010 when creating a webpart you could create and use and SharePoint components such as lists, libraries or workflows just about anywhere in the scope of where the webpart was being activated.

SharePoint 2013 adds an additional level of isolation (for security) whereby if an App is to need a SharePoint component such as list then it must contain this list within the apps own subweb – that app’s own App Web.  App Webs are usually inside the same site collection as the Host Web, except in tenant environments where they are in the App Catalog.  Apps that require their own web are reffered to as SharePoint hosted apps.

Apps that dont need access to any SharePoint objects such as lists, can exists without an App Web. e.g. those webparts which consume data from webservices etc. These are referred to as Provider Hosted Apps.

See example below where App 1 doesnt use any SharePoint component and therefore has no App Web, whereas App 2 uses lists and workflow and requires its own App Web:


Also, although the app web is typically in the same site collection as the host web it will have its own isolated domain.

For example, suppose that an app, with SharePoint components beyond
just the UI elements that can be deployed to a host web, is installed on
a host website at the following URL:

The app for SharePoint will be deployed to a newly created website with a URL like the following:

Note that this URL has the following structure:


  • Domain_Relative_URL_of_Host_Web is the relative URL of the parent host web, in this case sites/Marketing.
  • App_Name is the value of the Name attribute of the app element in the appmanifest.xml file.


Why to apps have their own web

Microsoft states two reason for requiring App Webs for Apps. Both are for security Enforcement of App permissions (see blog post) and Protecting against Cross-domain scripting attacks.

For more detailed information see the MSDN whitepaper

InfoPath form not working via ISA server – Form cannot be submitted – offline

If you get this error:

The form cannot be submitted to the Web server either because your computer is offline or because the host server is currently unavailable. If this problem persists, contact your network administrator.

you need to open the form inside the network, right click ‘view source’ and search for “g_objCurrentFormData”.

You’ll see something like:


You need to add a link translation to:



Strange…but works!

Populating InfoPath repeating section with C# programmatically and keeping formulas

There’s lots of tutorials showing how to programmatically fill in a repeating section or table in infopath using C#. However I only found one that shows how to do this without losing formulas, formatting and validation on the controls.

The process is to clone the first row in the repeating table instead of creating new ones.

Link here: