Field export problem?

Hi,

We are importing Word documents with fields, and then re-generating a copy of the word document upon export, including fields. Using the DocumentBuilder.insertField() method we are able to recreate the fields almost exactly as they appear in the original. Everything works fine, the only difference appears to be cosmetic: in Word, when placing the cursor in a field in the original document the field has a gray background. In the new document generated by Aspose the background is white still. This is cosmetic, but may confuse some of our users. Does anyone know why this might be happening? Possibly that FieldType dissapears? Field.Type is a read-only variable, so we cannot set it to be the same value as the original document.

Regards,

Mark

Hi

Thank you for your inquiry. I cannot reproduce the problem on my side using the latest version of Aspose.Words. Could you please attach your output document here for testing? Also which version of MS Words do you use?

Best regards,

Yes, sorry. I’m using Office 2008 for Mac to view the results on.

If it helps I can report that FieldType is actually being automatically set correctly in the document exported from Aspose - re-importing it again back into the pipeline shows that Field.FieldType is set correctly to the same values they had in the original document. So I’m not sure what the difference between the original and new document is, it might be specific to Word for Mac?

Regards,
Mark.

Hi

Thank you for additional information. But, I still cannot reproduce the problem on my side. Also which version of Aspose.Words for Net do you use for testing? To check version of the library, right click on the dll, select Properties from the context menu, then select Version tab. You will see File version.

To check version of Aspose.Words for java, unzip Aspose.Words.jar, open META-INF\ MANIFEST.MF file in notepad, you will see the following:

Manifest-Version: 1.0
Specification-Title: Aspose.Words for Java
Implementation-Title: Aspose.Words for Java
Specification-Version: 4.0.2.0
Implementation-Version: 4.0.2.0
Specification-Vendor: Aspose Pty Ltd
Implementation-Vendor: Aspose Pty Ltd
Copyright: Copyright 2003-2009 Aspose Pty Ltd

Best regards,

Hi, I’m actually running Aspose using mono on a unix system, so I’m not sure, but I did upgrade to the latest DLLs last week, v 9.1.0 I believe.

I’ll try to find a Windows system and test what happens there, if the gray is shown or not.
/Mark.

Same problem in Word 2007 on a Windows 7 system. Attaching the before and after example Word documents - one that has the gray background (FieldTest), the other without (FieldTestSave). I have even edited and re-saved the second document in Office to see if that would solve the problem, but it didn’t.

/Mark.

Hi

Thank you for additional information. Do you perform some processing of the document or just open/save using Aspose.Words? As I can see your document was not generated by Aspose.Words, or you made some post processing after inserting fields.

I use the following code for testing:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert DATE field.
builder.InsertField("CREATEDATE MERGEFORMAT", "");

builder.InsertField("PAGE", "");

doc.Save("out.docx");

Best regards,

Ah, my apologies! I had a lot of code for generating the document, and when I started to simplify it by removing code in order to find the cause it turned out that I was, by default, setting a highlightColor of white on all text. Removing this solved the problem!

Thanks,
Mark.

It is perfect, that you already resolved the problem. Please let me know in case of any issues. I will be glad to help you.

Best regards,