We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Changing keys by values

Hi people,

I have to do basically the following:

  1. read a template file (not a .DOT file, just an original file) in any type of Office (like .DOC, .PPT and .XLS);
  2. when I find some key (someword between delimiters like “[” and “]” or
    in expression language like ${xyz}), I select for that key in a database and get the
    correspondent value;
  3. with all the values found, a new file is generated changing the
    keys by the values, with the same format of the original file (template

I would like to know if is it possible to be done with Aspose. In some cases, I will need to change the key by an image instead of a text (formatted like the original file).

Thank you since now!


PS: I wann do it with the Java Aspose.

Thanks for your request. I think that you can use mail merge to achieve this. See the following links for more information.
How to prepare a template document
How to perform mail merge

I hope that it will help you.
Also, let me know if this doesn’t work for you.
Best regards.

Hi Alexey,

Thanks for the help! But, what about another files like .PPT and .XLS? And what about .PDF, could I do the same with the other files types?

Best regards,



Please, only now I saw that the examples (https://docs.aspose.com/words/net/types-of-mail-merge-operations/) are in C# and VB.NET.

Don’t you have an example in Java?

I must to do everything in Java.

Thanks in advance!


I think you can find some examples in the API reference. See the following link.
I hope this information will help you.
Best regards.

Hi Alexey,

That is a pretty good example, but this is in the Aspose.Words API.

Do you know if it is possible do the same with .PPT and .XLS files? And more, do you know if can change a field for an image (like the insertion of a .JPG image)?

Please, I need to know it before buy Aspose.

Thanks in advance!


Aspose.Words works with the following types of documents:

  • Microsoft Word (DOC)
  • Microsoft Office Open XML (DOCX)
  • Rich Text Format (RTF)
  • WordprocessingML (XML)
  • HTML and XHTML

You can use Aspose.Cells to work with .XLS files.
And Aspose.Slides to work with .PPT files.

Best regards.