none
MVC c# Asp.Net integration with Microsoft Word RRS feed

  • Question

  • I have an existing MVC application that I developed. It currently can download a Word .docx file and the user then has to open that file in Word to print, email, etc. If they change the document, my application does not know they changed it. The user would have to use extra steps to upload the file back to my application.

    I would like to change my application so that it automatically deposits the Word .docx file into an editor so that the user can modify the document, print it, etc. and then save the document. When they save the document, I would like the saved document to automatically be returned to my MVC application for storage in the application server environment.

    I have tried using an HTML version of the document and then returning that back to the server, however the WYSIWYG editors tend to add extra formatting (or remove formatting) that is important to the document. This has proven to be unusable (at least with the WYSIWYG editor I am using -- HTML5 Bootstrap).

    I believe that it should be possible to have some form of integration with Word (the user has Word installed -- or would have Office 365) so that they could receive the document, change it, and send it back seamlessly. I would like to use Word as the users are comfortable with this editing toolset, as am I.

    Is there such a solution out there? What would the components of this solution be? Are there examples of constructing such a solution (I don't need a fully working version -- just the pointers as to what the elements of the solution would be).

    Fred

    Monday, April 23, 2018 9:11 PM

All replies

  • Hi blueheron9152,

    You had mentioned that,"I believe that it should be possible to have some form of integration with Word (the user has Word installed -- or would have Office 365)"

    First you need to understand the ways to automate the Word documents.

    There are several ways available. like using VBA or using VSTO.

    If you use VBA or VSTO then machine need to available with Word application.

    But I can see that you are using MVC ASP.NET. Which is running on server.

    You cannot use Word automation on server. To verify the same you can refer link below.

    Considerations for server-side Automation of Office

    So in that case, You need to use Open XML that can work on server side and it also does not need to Office to be installed.

    Welcome to the Open XML SDK 2.0 for Microsoft Office

    Getting Started with the Open XML SDK 2.0 for Microsoft Office

    Word Processing

    The links are for Open XML 2.0 SDK but 2.5 SDK is available so you can try to use the latest one.

    Try to refer the API and code examples from the link and try to implement in your project.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 24, 2018 4:45 AM
    Moderator
  • Hi blueheron9152,

    Is your issue solved?

    I find that you did not follow up this thread after posting the issue.

    If your issue is solved then I suggest you to post your solution and mark it as an answer.

    If your issue is still exist then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 3, 2018 9:29 AM
    Moderator