getRawData method

getRawData()

Gets OLE object raw data.

getRawData()

Examples

Shows how to access the raw data of an embedded OLE object.

let doc = new aw.Document(base.myDir + "OLE objects.docx");

for (let shape of doc.getChildNodes(aw.NodeType.Shape, true))
{
  let oleFormat = shape.oleFormat;
  if (oleFormat != null)
  {
    console.log(`This is ${(oleFormat.isLink ? "a linked" : "an embedded")} object`);
    let oleRawData = oleFormat.getRawData();

    expect(oleRawData.length).toEqual(24576);
  }
}

See Also