my aim is to add a Ribbon Button which is opening a printing dialog for a selected file in a document library. I already added the Button with SP Designer and linked it with a html file which is calling the js.
The function printFile is called by the Ribbon.
function printFile() {
try{
//throws error
ExecuteOrDelayUntilScriptLoaded(start, "sp.js");
}catch(e){
alert(e.message);
}
}
function start() {
var ctx = SP.ClientContext.get_current();
var items = SP.ListOperation.Selection.getSelectedItems(ctx);
var selectedItem = '';
var itemURL;
for (index in items) {
//only for testing
alert(items[index].id);
alert(items[index].displayName);
printDocument(items[index].file);
}
}
When running i got this error:
The value of the property "ExecuteOrDelayUntilScriptLoaded" is null or undefined, not a Function object
Any idea to solve this error?