Questions re Aspose.Words

We are a software house based in London, England. We develop application using VB.NET (for windows) and ASP.NET (for web) and one of the requirements we have is generating standard template letters from data held within our system. Currently, we use MS Word. This is used to create the master template with mergefields and then during execution under program control we retrieve the data from our database, open and merge the relevant master template and then print it using Word Macros.
We want to replicate this functionality using a 3rd party tool rather than MS Word. We are happy to use MS Word to create the master templates but the rest we want to do using another tool.
Can you please let me know whether Aspose.Words can do the above? Key elements are open and mergings .doc or .docx files created by MS Word and also utilising the word macros.

This message was posted using Aspose.Live 2 Forum

Hi

Thank you for your interest in Aspose.Words. You can use Aspose.Words mail merge feature to fill your Word template with data. Please see the following link for more information.
https://docs.aspose.com/words/net/mail-merge-and-reporting/
Using Aspose.Words you can print your document, please see the link
https://docs.aspose.com/words/net/rendering/
Best regards,

Thank you for your reply. However, it does not answer my two questions directly:

  1. Can Aspose.Words read a .doc or .docx file that has been created by MS Word with mergefieds without any modifications? What we want to do is let our Admin users use MS Word to create and modify the master templates but when users are using it, we want to use Aspose.Words to open the MS Word created .doc or .docx, merge it and then print it
  2. As regards printing, from what you have indicated, it appears the Aspose.Words cannot use the macro facility within MS Word. In other words, we cannot open a .doc or .docx in Aspose.Words and say printing using MS Word macro xyz. Am I correct?
    As we are trying to retro fit a 3rd party component to an existing application, we need to understand the amount of work we need to do within our application and new functionality we need to add as regards printing etc. At present, our end users can create new macros which can have 1st page from Tray 2 and then subsequent pages from Tray 1, or print document ABC from printer 3 on tray1 etc without us getting involved as they or their IT dept can write the relevant MS Word macros

Hi

Thanks for your request and sorry for pure answer.

  1. Yes, of course, you can use existing MS Word document as templates. Aspose.Words supports wide set of document formats, like DOC, DOCX, RTF, WML etc. you can open any of these document formats using Aspose.Words and use it as a template. Please LoadFormat enumeration to learn import of which file formats supported by Aspose.Words:
    https://reference.aspose.com/words/net/aspose.words/loadformat/
    And SaveFormat enumeration to learn export to which formats is supported:
    https://reference.aspose.com/words/net/aspose.words/saveformat/
  2. Yes, you are right. Unfortunately, using Aspose.Words you cannot run MS Word macros. However, information about paper trays can be stored in Ms Word documents as an option of Section:
    https://reference.aspose.com/words/net/aspose.words/pagesetup/firstpagetray/
    https://reference.aspose.com/words/net/aspose.words/pagesetup/otherpagestray/
    Regarding selecting printer, as an option you can store printer name in CustomDocumentPropery and then during printing specify printer name:
    https://reference.aspose.com/words/net/aspose.words/document/print/
    Please let me know in case of any issues, I will be glad to assist you.
    Best regards,