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
file).

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!

Luiz

PS: I wann do it with the Java Aspose.

Hi

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
http://www.aspose.com/Products/Aspose.Words/Api/PreparingaDocument.html

How to perform mail merge
http://www.aspose.com/Products/Aspose.Words/Api/ExecuteSimpleMailMerge.html
http://www.aspose.com/Products/Aspose.Words/Api/ExecuteMailMergewithRegions.html

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,

Luiz

Alexey,

Please, only now I saw that the examples (http://www.aspose.com/Products/Aspose.Words/Api/ExecuteSimpleMailMerge.html and <o:p></o:p>
http://www.aspose.com/Products/Aspose.Words/Api/ExecuteMailMergewithRegions.html)
are in C# and VB.Net.

Don’t you have an example in Java?

I must to do everything in Java.

Thanks in advance!

Luiz

Hi

I think you can find some examples in the API reference. See the following link.

http://www.aspose.com/Products/Aspose.Words/Api/com/aspose/words/MailMerge.html

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!

Luiz

Hi

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.

http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/ProductOverview.html

And Aspose.Slides to work with .PPT files.

http://www.aspose.com/wiki/default.aspx/Aspose.Slides/ProductOverview.html

Best regards.