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.

C#:


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

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

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

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

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