Accepting all revisions will lose all fields?

Hi,

when I open the attached document and call AcceptAllRevision() and then attempt to access either field (FundName, TextType, Date, …) using sth like this: document.Range.FormFields[fieldName], I get null. When I do this before calling AcceptAllRevisions() I get a form field.

Please advise

Thanks

Kai

Dear Kai,

I have tested your document and it is worth to note that form fields disappear from the document model even if use Microsoft Word for accepting revisions in your document. I have logged your request as #1344 and we will try our best to resolve this issue ASAP.

Dimitry,

I didn’t know that and I (as you might have guessed) didn’t try it in the front-end. Yes, an option on AcceptAllRevision() would be nice.

One thing though: Before switching my application to Aspose.Words I was using Word/COM to accomplish my tasks. There I did AcceptAllRevisions() as well and I have never found myself with lost fields. Maybe something happened to the Word document and this is just coincidence that it happened now.

Thanks

Kai

Yes, it does look like some specifics of the document rather than Aspose.Words bug. But we’ll be able to tell you that once we have it investigated in-depth.

Thanks again for this. I’d really appreciate learning what is wrong with the document so that I may work around it or prevent the document from being sent out in the first place.

Kai

I looked at the document too and I don't think there is anything to fix here. The document is kind of damaged and it is better for you to fix the document that for us to fix the code.

The damage seems to be in that some vital piece of every form field in this document was somehow edited with tracking changes on. You can turn display of field codes on (Alt+F9) and turn display of tracking changes on and you will see a hint "Image v5.05IP deleted 11/06/2006 ...". Basically this means there is a tracked deletion in every form field in this document.

When you just open the file in Microsoft Word and right click on any of your form fields you can go into their properties fine.

But when you accept all revions in Microsoft Word and attempt a right click and go into properties of the form field - Microsoft Word complains this is no longer a valid form field.

So on this occassion Aspose.Words does exactly what Microsoft Word does - accepts a tracking change that makes a form field invalid.

Roman,

thanks for the thorough analysis and explanation. So somewhere something happened to the document and yes, you are right in saying that Aspose.Words works as expected.

I will add proper handling to my code in case a “corrupted” document gets delivered again.

Kai