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

Free Support Forum - aspose.com

Fied order


Is it ok to DOC file contains field which start with FieldSeparator. I have one such document.
I used following code which shows field which starts with FieldSeparator, also this is can be checked with DocumentExplorer.

public class FieldsTest {
public static void main(String args[]) throws Exception {
Document doc = new Document(“k:/bugs/ACTIV+CORP+test.doc”);

List fields = getFields(doc);

for(Object field:fields) {

private static List getFields(Document doc) throws Exception {
final List fields = new ArrayList();

doc.accept(new DocumentVisitor() {
public int visitFieldEnd(FieldEnd fieldEnd) throws Exception {

return super.visitFieldEnd(fieldEnd);

public int visitFieldSeparator(FieldSeparator fieldSeparator)
throws Exception {

return super.visitFieldSeparator(fieldSeparator);

public int visitFieldStart(FieldStart fieldStart) throws Exception {

return super.visitFieldStart(fieldStart);

return fields;

ACTIV+CORP+test.doc is in attachment.



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

Thanks for your request. I see in the header PAGE field does not have FieldEnd. This is not ok. Most likely the field was broken by some manipulations with document. You can see this if open this document in MS Word and press Alt+F9 to see field codes.

I think, you should reinsert the broken field.

Best regards.