ASP.net and Word 365 API - c#

So i am starting to learn the Office 365 API's, i have some experience with C# and ASP.net. But now i was wondering is there a way to make website which allows me to edit documents with Word Online and then download them to my server for example.
I know that i can download user files using the Office File API's, but is there a way to integrate the Word Online editor? The base idea is to create a very simple website which will allow me to create/edit files form the backend (admin interface) using the word online editor and then have these files available for download on the frontend.
The question is not about creating something practical so i don't want to use a alternative editor like ckeditor, mostly i want to see if it's possible and if so how can i do it.

Related

Edit docx/xlsx/pptx file online(in browser) without storing file in cloud and save changes back to server

Can you guys please help me in finding out how to edit microsoft documents online (in browser) without importing it to a cloudstroage and then saving back the changes to server.
Things to be noted:
I should be able to implement this in ASP.NET web forms.
No document should be stored over cloud.
Is webdav a better option compared to WOPI ?
if you want to use the browser edit experience that is in office online, you need to use Office Online Server installed on premise and the WOPI iframe that provides the office application.
More info can be found at https://learn.microsoft.com/en-us/officeonlineserver/office-online-server
If you do not wish to use sharepoint you need to provide another server to serve the files to the office online iframe.
One of the solutions is WOPI server that provides files for the office online server iframe locally from your infrastructure - there are many avaliable a good starting point is:
https://github.com/petrsvihlik/WopiHost

Using the One note API to save data from a Winform applciation on a Microsoft account

I am writing a ToDo list Winform application and I would like to use the the One Note API in order to save the information about the tasks in the user Microsoft account.
So I browsed the One Note API documentation but after a few hours of research I did not manage to find a good entry point.
I understand that the first step for me would be to sign the user which is described on this page:
https://msdn.microsoft.com/en-us/library/hh826543.aspx
The thing is that the different ways of achieving that step don't seem suitable for a Winform client application, maybe I should use the rest API ?
I have been looking for a .NET code example but have yet to find any so I'm quite confused right now...
Thanks for any help !
You can use the OneNote API - signing in can be achieved by using a webcontrol and having the user follow the sign in flow there. Unfortunately we don't have any sample code for winforms, but the auth flow in our NodeJs sample for the OneNote API should be similar.
https://github.com/OneNoteDev/OneNoteAPISampleNodejs
You could also (assumming the user has OneNote installed) use the OneNote interop libraries to interact with OneNote and store/retrieve your data there.
How To Write To A OneNote 2013 Page Using C# and The OneNote Interop
You might also want to try developing a universal app instead of a windows forms application:
https://github.com/OneNoteDev/OneNoteAPISampleWinUniversal

Client Side File manipulation in ASP.NET

I am an ASP.NET Developer. I want to develop a web app which will convert all the files with particular extensions from one format to another(eg : .txt to .docx or .docx to .txt) on the client machine. I can't see anything in ASP.NET that can do these things on the client machine. I was going through other SOPs and googling which was suggesting to use Silverlight, WPF, ActiveX scripts etc.
Please provide your suggestions. Thanks,

How to embed Google Docs or Office 365 editor?

I've already checked some questions here on SO but couldn't find much help...
This one, for instance, is from 2011:
Embed Google docs editor into webpage?
My users need to be able to edit their Word documents on my website, just like Google docs editor and Office 365. Since I couldn't find information on how to easily integrate those, my current attempt was to convert the Word document to HTML (using OpenXmlPowerTools.HtmlConverter.ConvertToHtml) show it in a HTML editor and after the user edited the content save it back to the file (using NotesFor.HtmlToOpenXml).
Is this going to work? Is there any way to integrate either Google Docs or Office 365 to my website, allowing user to edit their content right there? If not, is it possible to programmatically create a document, send it to Google Docs/Office 365 have the user edit it there and then get the document back to save locally again?
Box and Dropbox have done it:
https://blogs.dropbox.com/dropbox/2015/04/dropbox-and-office-online/
https://www.box.com/blog/introducing-box-for-office-online/
Thanks!
The only thing i've been working with is Office365, so my answer is based on that, but i think you would be able to do the same in Google Apps.
Right now it's not possible to embed a document from Office365 in your own website for editing, only for viewing, but i guess this might change at some point.
But what you could do is to create a document, upload it do OneDrive, get a link to that file and make a button to open it in Office Online, after the edit is done, then the file would be on the users OneDrive.
If you would like to get the file to your system, it's just a matter of getting access to the users OneDrive.
Most of the operations can be achieved with the Graph API, http://graph.microsoft.io/, and all of it can be done without the user having to do anything. You just need to get the right permissions for the app that gets acess to Office365.

Open/handle Word documents like SharePoint

Could anyone point me in the right direction when it comes to handling Word documents (.docx) on the server using asp.net.
I know I can write to and read the .docx document using the API provided.
But I would like to implement this like SharePoint does it. The user browses the web site, he is logged in, then chooses to make a new Word document in a folder, then the Word document downloads and opens locally. Then I would like the user to be able to save the document back to the server.
Alternatively, is there any good components for reading/writing Word documents in the browser. I have tried using the Telerik editor component without any luck.
First: About Sharepoint & Word: Sharepoint is using a protocol called WebDAV to provide this.
Afaik is WebDAV a standard protocol included with IIS (Install Windows Components). Windows can talk with WebDAV like it's some mounted drive, and therefore Word can handle .doc files that are served from there. To communicate with the WebDAV instance from ASP.NET you can use http://www.independentsoft.de/webdav/index.html.
I guess redirecting the user to the Word doc on the WebDAV server should get it working for the user, but I'm not sure about that. Never actually implemented a WebDAV solution.
Good editor: If you have a small set of users, you should have a look at xstandard, I found that by far the coolest rich text editor available. Yet it works with Java/ActiveX, so your users should install the component at first, but it supports image drag-drop etc. I have never seen a native in-browser editor that gives me a good experience (Telerik came closest 2 years ago).
You can integrate with the Zoho writer api http://writer.zoho.com/home?serviceurl=/index.do

Categories

Resources