how to read the web.config file values in office addins office.js - office365-apps

i am developing an excel add-ins using office.js, i want to keep the different configuration settings in the web.config files, and read those settings in the java-script file. how to do that.
is office add-in sample project is MVC asp.net project, should i be returning the view from there and my source location in manifest point to that view.
please guide me to correct approach.

Generally speaking, this is not something that is Office Add-in specific. You would you would use the same approach as with a regular website. For example, see Reading web.config from JavaScript.
In terms of the manifest start URL, you can point it at any web-browsable page, it doesn't have to end with .html. So you can use an aspx or MVC view page. Alternatively, you can have an html/js/css page that makes an AJAX web service call to your own web API that returns you the settings. If I may recommend, see my blog post for how to create a web service for an Office Add-in using the ASP.NET Web API.
Hope this helps!
~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT

Related

Implementing Microsoft Word onto website or very similar

I need to implement Microsoft Word into my works website and I'm having real trouble trying to find any information about it. Is there a way to do this? I need mail merge functionality but I don't mind whether it just works with my website (database website)rather than being implemented into it
(I've used CKEditor and TinyMCE but neither are useful for my website/work. I need it to be simple and I'm working with people who just know basic Word)
I don't think you can embed (real) Microsoft Word editing functionality in an arbitrary website.
However, if you are running a Sharepoint server, then you can upload MS Word documents to Sharepoint and edit there them via a web browser via "word Web App". It also allows the user to "one click" download a document and edit it Word installed on their machine.
References:
Microsoft's Introduction to Word Web App
Alternatively, if you are prepared to look at 3rd-party solutions, some are listed in these Q&As:
Embed editable MS Word document on web page
Making Word document embedded in a web page editable or read-only
However, this is dangerously close to asking for a recommendation for software or a web-based service, and that is off-topic.

301 re-directs pointing from old asp CMS to new CMS php pages

I have an old cms site based on asp which I need to move to an PHP based CMS - I have searched for web.config examples (its running on a windows server). All the examples I find show re-directing html to html (which I can replicate on my server with a web.config file) when I try to re-direct something a bit more complicated the re-direct is ignored and the original page loads. Can someone give me an example of how I would re-direct from say:
http://www.domainname.co.uk/default.asp?contentID=2 to
http://www.samedomainname.co.uk/index.php?page=repair
I guess its just syntax knowledge - I have about half a dozen specific pages that I need to map to new pages and I do not want to lose the traffic !.
Cheers

CMS with Word import or paste

I am working on a project where we are taking a bunch of documents authored using MS Word and placing them online. Currently they are being published as PDF documents in order to maintain the formatting.
We are evaluating Content Management Systems (CMS), however, there is a bit of reluctance among the content publishers to use the CMS built in WYSYWIG editor. I can understand why, they are nowhere near as good as Word!
Some CMS have decent 'paste from Word' functions, but the one I have found that handles images as well is this Wordpress pluging.
My question is - are there any Content Management Systems that have been built with Word integration in mind? Something that makes it as easy as possible to publish Word documents as HTML.
So far from what I have seen, Microsoft Sharepoint had the best integration with the MS Office. I think most of them use Sharepoint as a intranet portal, but it could be also hosted as a public facing website. But compared to other CMS, it can be little pricey. But it has tons of features apart from content management.
Sharepoint Demo
Public Facing Sharepoint Websites
Microsoft Word does publish documents as HTML.
File > Save As > Web Page (Filtered)
Office.com - Save a document as a webpage
ahmednuaman/gdrive-cms-php uses Google Drive as a pseudo back-end to store and edit pages (Documents).
The self-hosted PHP and MySQL CMS requests text/HTML-exports of to display as web pages.
It also simplifies authentication and group permissions (if the editors are already Google/Drive users).

How do I integrate MS Word into a web page?

I have a section of a web application I’m working on where there are mail merge templates. The documents are word documents. When a user has need to edit the template I’d like them to be able to simply click edit, which would cause word to load with the document loaded. When the user is done, they click save in word and the web page spots the change in the file and pushes this back to the server.
I managed to create a VBScript in a web page that could do all of this, but only when internet explorers security was turned down. The fact that I’m using VBScript to automate is not good as it restricts the browser choice and I’m not happy asking my users to turn their security down.
I don’t want the users to download the file, edit it, save it to their local machine and then upload it back to the server, it’s all very clunky. I also know that there are 3rd party controls that allow editing in a page, but I'd rather avoid them if I can.
Is there an alternative way of approaching this?
You can use Office Open XML to generate the word documents on the Server Side. There is an msdn article, sorry no time to go searching for it, explaining why you should not automate office from web servers using COM/DCOM because of security issues involving shared memory.
you could use google docs API, which is certainly more universal than using proprietary technology that works in one and only browser (IE).
I think you can go for the google docs API. It is more generic solution to go for too.
It is possible, with browser-security caveats, to open Word documents for edit from a browser via an UNC path on an internal network.
The best option currently is to WebDAV enable your website, and use the SharePoint plug-in client-side to open the file in Word over WebDAV.
The SharePoint plug-in for IE gets installed when you install Office. There is also a plug-in for Firefox/ Chrome referred to as NPAPI. Beware NPAPI seems to have an issue with long URL paths.
IT Hit make a terrific framework for WebDAV enabling a .NET-based website, see http://www.webdavsystem.com/. They also sell a client-side library that can open Word documents via Java instead of the plug-ins mentioned above. IIS has it own, more basic, WebDAV capability that you can use too.
I am not familiar with non-.Net / Apache solutions but just search for WebDAV products.
Office will require the use of HTTPS for editing via WebDAV.

Office integration (Word) - intercepting save

I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC.
This is the easy part ;)
Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a custom function (maybe in a .NET DLL) that uploads the saved file back to the server (HTTP). The hard part seems to me:
How to intercept the Save process to call the extension functionality
How to deploy this to multiple users
Mike's link to the question I answered should do it for intercepting the file save. The specific button idMso for File->Save is "FileSave"
To deploy it to several users machine you can either
Create a setup project that will create an msi that you can run on all the users machines
if it's an intranet scenario, you can keep the assemblies on a network location and just add the neceassary registry settings to all the users machines. This article should describe the settings that you need to include. You would just need to change the path setting to point to the network location.
AFAIK, this is what Alfresco is doing with its Microsoft Office Add-ins (never tested myself though). As Alfresco is open-source, it must be possible to look at what they are doing. Or just ask your questions on Alfresco's forums.
You can try to override "save" from the ribbon or build your own ribbon tab with the behavior you want. It may be trickier overriding "Ctrl-S".
Overriding the ribbon: StackOverflow Question
Video on altering a standard ribbon button: Office Developer Center