Share via


Microsoft Office Binary File Format Validator Command Line Usage

[This is prerelease documentation and is subject to change in future releases.]

Applies to: Excel | Office 2007 | Office client | PowerPoint | Word

In this article
Example Scan of a File that Passes Validation
Example that Attempts to Validate an Unsupported File Type
Example Scan of a File that Fails Validation

The Microsoft Office Binary File Format Validator Beta is a command-line tool (BFFValidator.exe) that provides file format validation and debugging information for implementers of Microsoft Office binary file formats. The file types that are validated are .doc files, .xls files, and .ppt files. Encrypted files, password-protected files, and embedded objects are not validated. The specific validation behavior is listed in the following table.

File or object type

BFFValidator outcome

.doc files for Microsoft Word 97, Microsoft Word 2000, and Microsoft Office Word 2003.

Validated

.xls files for Microsoft Excel 97, Microsoft Excel 2000, and Microsoft Office Excel 2003.

Validated

.ppt files for Microsoft PowerPoint 97, Microsoft PowerPoint 2000, and Microsoft Office PowerPoint 2003.

Validated

Password-protected files and encrypted files.

Not validated

Information Rights Management (IRM) files.

Not validated

Any embedded objects, such as an OLE object or executable file, inside a file.

Not validated

Important

Because Microsoft Office Binary File Format Validator Beta stops for any file format error, it is important that you re-run the validation after you have fixed each error, until BFFValidator.exe finishes with a PASSED result.

Use the following command-line syntax to validate a binary file format file.

Bffvalidator.exe [-l log.xml] [-v] filename.ext

Parameters

Argument

Description

-l log.xml

Optional. Specifies the location of the output log file. If this parameter is not specified, the log file is written to the same location as the file that is scanned. The file name of the log file is the name of the file that you scanned and a time stamp, for example "Sample document.doc.bffvalidator.01-25-11_09-00-43.xml." For more information about the log file, see Microsoft Office Binary File Format Validator Log File.

-v

Optional verbose mode. The BFFValidator will display each byte that is read to the Command Prompt window. If the validated file is large, generating this display will be time-consuming. You can use this information for debugging your file format.

Filename.ext

Required. Specifies the file path, file name, and the extension of the file to be validated.

-?

Displays the command syntax and options for BFFValidator.exe.

The Command Prompt window displays the following pass/fail error and file name information:

  • Pass or fail result of the validation scan.

  • The name and location of the file that was scanned.

  • Error information if the command was used incorrectly, or another reason why the specified file could not be scanned.

  • The date and time when the validation was completed.

  • The location of the log file that was created for this run. If the run fails, the Command Prompt window will specify whether a log file was created or not.

  • If the result of the scan is FAILED, an HTTP link to a file format specification with more information about the correct format of the binary data is provided.

If you run the scan in verbose mode, the Command Prompt window additionally displays the stream information about where the Microsoft Office Binary File Format Validator Beta is reading and the corresponding offsets.

Detailed information about the scan result is written into a log file. It includes information about the nature of the failure, location of the failure in the stream, and a link to a particular section in a file format specification that defines the correct behavior. For more information, see Microsoft Office Binary File Format Validator Log File.

Example Scan of a File that Passes Validation

The following example runs a scan of a .doc file that passes:

C:\Program Files\Microsoft Office\BFFValidator>bffvalidator.exe "C:\users\Alice\Documents\Sample_document.doc"

The Command Prompt window message includes the location of the file that was scanned, the time stamp of when the scan was finished and the location of the log file.

PASSED at 02/03/11 10:14:19
Log at: C:\users\Alice\Sample document.doc.bffvalidator.02-03-11_10-14-19.xml

The log file contains the following information. For more information about the log file, see Microsoft Office Binary File Format Validator Log File.

<BFFValidation path="C:\users\Alice\Sample document.doc" datetime="02/03/11 10:14:19" result="PASSED">
</BFFValidation>

Example that Attempts to Validate an Unsupported File Type

The following example attempts to run a scan of a .docx file:

C:\Program Files\Microsoft Office\BFFValidator>bffvalidator.exe "C:\users\Alice\Documents\Sample_document.docx"

The Command Prompt window message includes an error message and the location of the log file.

BFFValidator: "C:\users\Alice\Sample_document.docx" NOT RECOGNIZED at 01/25/11 10:32:00
Log at: C:\users\Alice\Sample_document.docx.bffvalidator.01-25-11_10-32-00.xml

The log file contains the following information. For more information about the log file, see Microsoft Office Binary File Format Validator Log File.

<BFFValidation path="C:\users\Alice\ Sample_document.docx " datetime="01/25/11 10:32:00" result="NOT RECOGNIZED">
</BFFValidation>

Example Scan of a File that Fails Validation

The following example runs a scan of a .ppt file that contains an error. Therefore, the scan returns a result of FAILED.

C:\Program Files\Microsoft Office\BFFValidator>bffvalidator.exe "C:\users\Alice\Documents\Sample_document.ppt"

The Command Prompt window message includes the location of the file that was scanned, the time stamp of when the scan was finished, the location of the log file, a message that indicates that a binary error was found, and a link to an overall stream location in the [MS-PPT] binary file format specification.

BFFValidator: "C:\users\Alice\Documents\Sample_document.ppt" FAILED at 01/25/11 10:44:35
Log at: C:\users\Alice\Sample_document.ppt.bffvalidator.01-25-11_10-44-35.xml
See: https://msdn.microsoft.com/en-us/library/dd945780(v=office.12).aspx for more information

Additionally, the last few entries in the log file contain information about the last four bytes that were read and a more specific link to the data from [MS-PPT]. For more information about the log file, see Microsoft Office Binary File Format Validator Log File.

<Type docName="MS-PPT" sectionTitle="TimeOverride" sectionNumber="2.8.41" msdnLink="https://msdn.microsoft.com/en-us/library/20CE9A31-8EAA-4A42-B957-B9111BE76B2C" streamName="PowerPoint Document" streamOffset="105175" hexStreamOffset="0x19ad7"/>
    <Type builtinType="LONG" streamName="PowerPoint Document" streamOffset="105184" hexStreamOffset="0x19ae0" childId="3" hexChildId="0x3">
      <Info>Built-in type "LONG": Signed 4-byte integer.</Info>
    </Type>
  </ParseStack>
  <LastData><![CDATA[
00 00 00 00 -- -- -- --  -- -- -- -- -- -- -- --  ....
]]></LastData>
</BFFValidation>

See Also

Other Resources

Introduction to Microsoft Office Binary File Format Validator