ExportMe

Take a peek, see that little Export Me in the above picture? I just had to click my bookmarklet to produce this link which allows for a direct export of any visible web part. This uses a trick I found on CHUVASH.eu which highlights that there’s a special ‘exportwp.aspx’ page within SharePoint that when handed the webpart GUID and page url will provide the export XML download. Neat? Neat.

Bookmarklet

Taking neat a step up I just whipped up some JavaScript to dynamically load jQuery then search for the web parts and output a direct link. Handy for when web parts have exporting off, or just refuse to do so. That said this is the handy bookmarklet, drag that into your favorites and use it whenever needed while on a page in SharePoint.


SharePoint Export WebPart Bookmarklet

Drag into Favourites

 

Source

(function() {
    var script = document.createElement("SCRIPT");
    script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
    script.type = 'text/javascript';
    document.getElementsByTagName("head")[0].appendChild(script);

    var checkReady = function(callback) {
        if (window.jQuery) {
            callback(jQuery);
        }
        else {
            window.setTimeout(function() { checkReady(callback); }, 100);
        }
    };

    checkReady(function($) {
		$("[webpartid]").each(function(i,value){ 
			var wpGuid = $(this).attr('webpartid');
			var pageUrl = location.origin + _spPageContextInfo.serverRequestPath;
			var requestUrl = _spPageContextInfo.siteAbsoluteUrl + "/_vti_bin/exportwp.aspx?pageurl=" + pageUrl + "&guidstring=" + wpGuid;
			$(this).prepend("<a href='" + requestUrl + "'>Export Me</a>"); 
		});
    });
})();

Comments 1

Pingbacks

Leave a Reply

Your email address will not be published. Required fields are marked *