Free Support Forum - aspose.com

MailMergeSettings lost upon saving document

Hello,

We have word documents with mailMergeSetting mainDocumentType on FORM_LETTERS
when we parse the document it seems to recognize this correctly.
But the setting is Lost upon saving the document…
It becomes the default mainDocumentType.

In the example below we open a document with mainDocumentType correct
we get the MailMergeSettings and check if they are correct.
finally we save the document and then the settings are lost.

InputStream wordInputStream = this.getClass().getResourceAsStream("/Documents/agenda-provincieraad.doc");
Document doc = new Document(wordInputStream);
MailMergeSettings mailMergeSettings = doc.getMailMergeSettings();
System.out.println(" mainDocumenttype == " + mailMergeSettings.getMainDocumentType());
assertEquals(MailMergeMainDocumentType.FORM_LETTERS, doc.getMailMergeSettings().getMainDocumentType());
doc.save(USER_HOME + “/result.doc”);

Is this a bug and is there a workaround or are we missing something here.
we are using the newly released version 3.3

Kind regards,
Jan From Cronos


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Could you please attach your document here for testing? I will check the problem on my side and provide you more information.

Best regards,

I’ve uploaded the document in “agenda-provincieraad.zip”

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

This happens because you have only selected the mail merge document type, but have not selected a mail merge data source in MS Word. If you select a mail merge data source in MS Word then all mail merge settings will be preserved.

Oke thnx.
But is there any chance I can save the MainDocumentType without having a DataSource?
The
problem is here in the company they have some custom menu to merge from
a central database. And they check that the main document type is
something else than a default word document, if it isn’t they give a
error message.
So when we generate our Word document with
Aspose.words we want to set the MainDocumentType but we havn’t a
DataSource. If I put some dummy datasource name in the document, Word
gives some message that it can’t find the datasource when we open the
document.

Grtz

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. We will let you know one this issue is resolved.

Best regards,

Is there already a solution for this? Because we are really stuck on this one. There are other properties we need that are also lost when we save without a datasource…

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Unfortunately, the issue is still unresolved. Please expect a reply before next hotfix (within 4-5 weeks). We might just fix the problem or provide you more information.

Best regards,

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan