question

SunilFerro-4077 avatar image
0 Votes"
SunilFerro-4077 asked LanHuang-MSFT commented

Edit a Word document within the browser

Hi,

I have an ASP.NET web application which has a page to upload Word documents. I am looking for the ability to open/edit Word documents from within the Web application/browser itself and retain the document formatting. All this without the need to have MS Word installed.

From within the Web application, is it possible to call MS Office 365 web which will launch the Word document in a separate browser tab for the user to edit? Is a license needed for this? I think the user would need to have an Office 365 account to be able to access/edit the document. Could you please let me know?

Thank you.

office-itprodotnet-aspnet-generaldotnet-aspnet-webforms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LanHuang-MSFT avatar image
0 Votes"
LanHuang-MSFT answered LanHuang-MSFT commented

Hi @SunilFerro-4077,
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
For more information, please visit Considerations for server-side Automation of Office.

So I suggest you to use Open XML SDK to manipulate Office documents or use 3rd party library.
You could visit Word processing (Open XML SDK) to see several samples.
https://docs.microsoft.com/en-us/office/open-xml/word-processing?redirectedfrom=MSDN
3rd party library:Free Spire.DocAsposetextcontrol
Best regards,
Lan Huang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, thank you for the response. The thing about 3rd party libraries is that the original document formatting is not retained. Except for TextControl, the others seem to have formatting issues when I tried them out. Could you please let me know your thoughts on Documentum? https://www.youtube.com/watch?v=0qquaIjypek
Can it be integrated in our web application to achieve what we need?
Thank you.

0 Votes 0 ·

Hi @SunilFerro-4077,
For third-party questions, I suggest you go to the third-party forum.
https://forums.opentext.com/forums/developer/categories/documentum_developer
Best regards,
Lan Huang

0 Votes 0 ·

Thank you.

0 Votes 0 ·

Hi @LanHuang-MSFT
I just want to elaborate on the requirement. We have a Web based File Management system in which Word documents are uploaded. Documents are stored in the database. We would like to allow the Word document to be launched for editing in a separate tab in the browser using Microsoft 365 Word online.
The user can edit the document, close the tab, the edited Word document is pushed back to the application/database similar to how other vendors do this and also similar to Microsoft Teams Web version.
We want it to be a seamless process which eliminates the need for the user to download documents to the local drive, edit and upload it back to the application.

Could you please let me know if there is an API that Microsoft provides or any other way that can help achieve this?

Thank you.

0 Votes 0 ·

Hi @Sunil-9097,
The answer suggests that you use the Open XML SDK to manipulate Office documents or use a 3rd party library.
You can refer to the link provided.
Best regards,
Lan Huang

0 Votes 0 ·