In this article I will demonstrate how to add a local shared drive to your Trust center which will facilitate developing basic Add-In functionality locally. This will not works for Add-Ins which require internet access (c:\local cannot call https) but for testing out your Word API skills this is perfect.
Taking from the example (which you should read first) I am going to modify the section about adding a trust center with an example.
My files are located at c:\Users\mroden\WebstormProjects\Azure\xomino365\localWordDev
Adding the Trust Center
Within Word 2016 select
- Trust Center
- Click the Trust Center Setting Button
- Select the Trust Center Add-Ins option on the left
In the Catalog URL bar I add \\localhost\C$\Users\mroden\WebstormProjects\Azure\xomino365\localWordDev and “Add Catalog”
The Catalog is added as a network share
make sure you check the “Show in Menu” option and restart Word
Using the example manifest
Using the example manifest provided in the Github Project (link again) and my own GUID I was able to create a manifest to my local files like this
<?xml version="1.0" encoding="UTF-8"?> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp"> <Id>0646c7a1-c876-482b-9119-e0f25c30b610</Id> <Version>22.214.171.124</Version> <ProviderName>Microsoft</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue="Boilerplate content" /> <Description DefaultValue="Insert boilerplate content into a Word document." /> <Hosts> <Host Name="Document"/> </Hosts> <DefaultSettings> <SourceLocation DefaultValue="c:\Users\mroden\WebstormProjects\Azure\xomino365\localWordDev\App\Home\home.html" /> </DefaultSettings> <Permissions>ReadWriteDocument</Permissions> </OfficeApp>
Using that I was then able to run the example code. There were a couple of warning though to accept to get this to work.
There we have it – the locally hosted example working.
Using the technique to add firebuglite to the Add-In I was then able to start to copy an paste example code from Microsoft examples and start to learn the Word API and its nuances.
I am also found this Office Snippets site which was GREAT to get started as well
Being able to map a localhost as a “network drive” allowed me to get started without the need to constantly check code into my local Git repository and sync it with Azure