none
Generate document using Word templates RRS feed

  • Question

  • Hi All,

    We are developing an application that is expected to cover two functionalities, #1 is to get User inputs, #2 is to replace those values with tags in predefined Word template.  #1 (User Interfaces) will be developed in ASP.NET but we are not sure how to achieve the functionality #2 (manipulate the word template with inputted data and generate the final Word documents). Now exploring the Open XML SDK 2.0 for Word manipulations, any other options exist?

    Please share a simple proven approach using Microsoft's tools/libraries/open source etc.

    Thanks in advance

    Thursday, May 18, 2017 11:40 AM

Answers

  • Hello,

    >> #1 (User Interfaces) will be developed in ASP.NET

    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 use OpenXML to manipulate Office Open XML formats documents. You could visit Word processing (Open XML SDK) for samples.

    Regards,

    Celeste


    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.

    • Marked as answer by Tech01230 Wednesday, May 24, 2017 9:26 AM
    Monday, May 22, 2017 1:40 AM
    Moderator
  • Solution guidance is given in below link

    https://social.msdn.microsoft.com/Forums/en-US/9349554f-70ee-4b2a-8e91-0bb14f6f73ce/vba-replacement?forum=isvvba

    • Marked as answer by Tech01230 Wednesday, May 24, 2017 9:25 AM
    Wednesday, May 24, 2017 9:25 AM

All replies

  • Hi All,

    We are developing an application that is expected to cover two functionalities, #1 is to get User inputs, #2 is to replace those values with tags in predefined Word template.  #1 (User Interfaces) will be developed in ASP.NET but we are not sure how to achieve the functionality #2 (manipulate the word template with inputted data and generate the final Word documents).

    Now exploring the VSTO/Open XML SDK 2.0 for Word manipulations, any other future-oriented options exist? 

    As VBA is great lang for office applications, Is VBA (macros) still recommended to use from future .NET  applications?

    What is the road-map for VBA now? similarly, what is the road-map for VSTO for using in strategic solutions ?

    Can we still consider investment in solution (.NET Form connect to VBA macro) approach?

    Please share your views using VBA/VSTS or any other proven Microsoft's tools/libraries/open source considering future.

    Thanks in advance


    Friday, May 19, 2017 5:01 AM
  • Hello,

    >> #1 (User Interfaces) will be developed in ASP.NET

    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 use OpenXML to manipulate Office Open XML formats documents. You could visit Word processing (Open XML SDK) for samples.

    Regards,

    Celeste


    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.

    • Marked as answer by Tech01230 Wednesday, May 24, 2017 9:26 AM
    Monday, May 22, 2017 1:40 AM
    Moderator
  • Hi Tech01230,

    The below article illustrates the same as you expected and it's based on a free .NET Word library, you can have a check:

    http://www.c-sharpcorner.com/uploadfile/38268a/create-word-document-from-win-form-with-users-data/

    Wednesday, May 24, 2017 2:26 AM
  • Solution guidance is given in below link

    https://social.msdn.microsoft.com/Forums/en-US/9349554f-70ee-4b2a-8e91-0bb14f6f73ce/vba-replacement?forum=isvvba

    • Marked as answer by Tech01230 Wednesday, May 24, 2017 9:25 AM
    Wednesday, May 24, 2017 9:25 AM