Discuss this help topic in SecureBlackbox Forum

Access internal storage of MS Office document

To get access to the internal CFB (Compound File Binary Format) storage of the MS Office binary document you need to use TElOfficeBinaryDocument.Storage property, which returns TElCompoundFileStorage object.


bool CheckIfDocumentIsSpreadsheet(TElOfficeDocument Document)
    if (Document.BinaryDocument == null)
        throw new Exception("Invalid document");

    return Document.BinaryDocument.Storage.RootEntry.StreamExists("Workbook");

function CheckIfDocumentIsSpreadsheet(Document : TElOfficeDocument) : Boolean;
  if not Assigned(Document.BinaryDocument) then
    raise Exception.Create('Invalid document');

  Result := Document.BinaryDocument.Storage.RootEntry.StreamExists('Workbook');

The code above is equivalent to check if TElOfficeBinaryDocument.DocumentType is equal to dtSpreadsheet value.

How To articles about MS Office binary documents

Discuss this help topic in SecureBlackbox Forum