Name: Word-Add-in-ClauseLibrary-Code-Sample
Owner: Office Developer
Description: null
Created: 2015-12-15 18:14:54.0
Updated: 2017-01-10 01:06:24.0
Pushed: 2018-01-31 20:26:00.0
Homepage: null
Size: 2221
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repository shows how you can build a library of clauses that can be added to a word document.
These clauses can then be reused within documents. The clauses can be stored to any SharePoint library
that contains the app.
The solution demonstrates authenticating of users via the Azure AD. It utilizes the Office 365 Discovery Client to identify a users' SharePoint Online resource, and uses REST calls to communicate to SharePoint. The Office Add-In is then constructed with an Angular application demonstrating some of the capabilities of the Office JS libraries.
Note: If possible, please use this sample with a “non-work” or test account in Office 365. With the current version of the project, it does not clean up the created lists within any connected SharePoint Online subsite. At this time you'll have to manually remove these artifacts, for example, the clauses, groups, and tags lists.
To run this sample, you need:
Office Word 2013 or higher
A Microsoft Azure subscription with a Microsoft Azure Active Directory (AD) tenant to register your application. Azure AD provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: Microsoft Azure.
Office 365 Developer account. You can join the Office 365 Developer Program and get a free 1 year subscription to Office 365. Create a new subsite under your SharePoint Online subscription. You will also need to ensure that you are under the First Release update path. To check this on your Office 365 subscription, navigate to https://portal.office.com as an administrator. Under the Admin view, navigate to Service Settings -> Updates. Ensure that you are on First release. This may take up to 24 hours to be activated.
Log on to your SharePoint online site.
Click on the settings cog in the navigation header. Navigate to Site Contents.
Scroll down until the Subsites section is visible. Click on the “new subsite” link.
Enter a title and description for the subsite. Enter a new URL for the subsite. Remember this address.
Leave the template as the default (Collaboration/Team Site). Scroll to the bottom and click Create to finalize the subsite.
From your Git Shell or Command line:
git clone https://github.com/OfficeDev/Word-Add-in-ClauseLibrary-Code-Sample
Connect to the Azure Management Portal and navigate to the Azure AD tenant.
Navigate to the Applications Section, and then click on the Add button on the command bar.
When prompted by the wizard, select “Add an application my organization is developing”.
On the next screen, type in a name for the Azure AD Application.
Give the application a valid URL for the Sign-on URL property, and a unique App ID URI (e.g. http://clauselibrary). These URLs do not need to exist. Create the application.
Your Azure AD Application should now be created. Navigate to Configure.
Under the Reply URL settings, add the URL of the authentication callback path.
This should be the Project URL (copied earlier), with the route /authentication/processcode
i.e.
http://localhost:57697/Authentication/ProcessCode
This AD application must also be granted specific permissions for SharePoint Online:
Take note of the Client ID value for the application.
Create a new key secret. This will be provided after the application configuration has been saved.
Save the application. You should now be able to retrieve the generated key.
Take note of this key secret.
Click the Log in to Clause Library link and enter your Azure AD credentials in the corresponding dialog.
If a login error occurs, try some of the following:
You will be prompted to create a library. In the SharePoint URL field, enter the full URL
of the SharePoint Online subsite that you have created earlier. E.g. https://{your-sharepoint-tenant}.sharepoint.com/clauselibrary
Enter a name and description for your new clause library, and finish by clicking Create.
The Clause Library application will create the necessary lists at the specified SharePoint subsite, and will connect the application. Clauses can now be remembered and recalled.
The above instructions leverage IIS Express. To turn things up a notch, why not try running this in Azure.
Copyright (c) 2015 Microsoft. All rights reserved.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.