public class FieldEmbed extends Field
To learn more, visit the Working with Fields documentation article.
Examples:
Shows how some older Microsoft Word fields such as SHAPE and EMBED are handled during loading.
// Open a document that was created in Microsoft Word 2003.
Document doc = new Document(getMyDir() + "Legacy fields.doc");
// If we open the Word document and press Alt+F9, we will see a SHAPE and an EMBED field.
// A SHAPE field is the anchor/canvas for an AutoShape object with the "In line with text" wrapping style enabled.
// An EMBED field has the same function, but for an embedded object,
// such as a spreadsheet from an external Excel document.
// However, these fields will not appear in the document's Fields collection.
Assert.assertEquals(0, doc.getRange().getFields().getCount());
// These fields are supported only by old versions of Microsoft Word.
// The document loading process will convert these fields into Shape objects,
// which we can access in the document's node collection.
NodeCollection shapes = doc.getChildNodes(NodeType.SHAPE, true);
Assert.assertEquals(shapes.getCount(), 3);
// The first Shape node corresponds to the SHAPE field in the input document,
// which is the inline canvas for the AutoShape.
Shape shape = (Shape) shapes.get(0);
Assert.assertEquals(ShapeType.IMAGE, shape.getShapeType());
// The second Shape node is the AutoShape itself.
shape = (Shape) shapes.get(1);
Assert.assertEquals(ShapeType.CAN, shape.getShapeType());
// The third Shape is what was the EMBED field that contained the external spreadsheet.
shape = (Shape) shapes.get(2);
Assert.assertEquals(ShapeType.OLE_OBJECT, shape.getShapeType());
getDisplayResult, getEnd, getFieldCode, getFieldCode, getFormat, getLocaleId, getResult, getSeparator, getStart, getType, isDirty, isDirty, isLocked, isLocked, needStoreOldResultNodes, remove, setLocaleId, setResult, unlink, update, update