This solution is based on the SharePoint-hosted app template provided by Visual Studio 2012. The solution enumerates through each document library in the host website, and adds the library to a drop-down list.
When the user selects a library and clicks a tile, the app creates a sample Word 2013 document by using OOXML in the selected library.
This sample requires the following:
Visual Studio 2012
Office Developer Tools for Visual Studio 2012
Either of the following:
SharePoint Server 2013 configured to host apps, and with a Developer Site collection already created; or,
Access to an Office 365 Developer Site configured to host apps.
Key components of the sample
The sample app contains the following:
The Default.aspx webpage, which is used to enumerate through each document library in the host website, and render tiles for each MP4 video in the app.
The Point8020Metro.css style sheet (in the CSS folder) which contains some simple styles for rendering tiles.
The AppManifest.xml file, which has been edited to specify that the app requests Full Control permissions for the hosting web.
References to the DocumentFormat.OpenXml assembly provided by the OpenXML SDK 2.5.
All other files are automatically provided by the Visual Studio project template for apps for SharePoint, and they have not been modified in the development of this sample.
Configure the sample
Follow these steps to configure the sample.
Open the SP_Autohosted_OOXML_cs.sln file using Visual Studio 2012.
In the Properties window, add the full URL to your SharePoint Server 2013 Developer Site collection or Office 365 Developer Site to the Site URL property.
No other configuration is required.
Build the sample
To build the sample, press CTRL+SHIFT+B.
Run and test the sample
To run and test the sample, do the following:
- Press F5 to run the app.
- Sign in to your SharePoint Server 2013 Developer Site collection or Office 365 Developer Site if you are prompted to do so by the browser.
- Trust the app when you are prompted to do so.
The following images illustrate the app. In Figure 1 the app has been trusted and libraries added to the drop-down list.
In Figure 2, the user has clicked the orange tile. The document is created and the red tile provides a link to the appropriate library (Figure 3), which the user reaches by clicking on the red tile.
Ensure that you have SharePoint Server 2013 configured to host apps (with a Developer Site Collection already created), or that you have signed up for an Office 365 Developer Site configured to host apps.
First release: January 30, 2013.