## Complex File Format

There are some differences between the file format of a full saved document and that of a fast saved document. In previous versions of Word, one of the differences was the necessity of the "complex" table information. In Word '97 and later, the fcClx always indicates the location of the "complex" table information and it is always necessary to determine the location and contents of text and properties. This arises due to unicode and unicode compression.

fcClx is the fc where the complex part of the file begins, and cbClx is the size (in bytes) of the complex part. The complex part of the file contains a group of grpprls that encode formatting changes made by the user and a piece table (plcfpcd). The piece table is needed because the text of the document is not stored contiguously in the file after a fast save.

The complex part of a file (CLX) is composed of a number of variable-sized blocks of data. Recorded first are any grpprls that may be referenced by the plcfpcd (if the plcfpcd has no grpprl references, no grpprls will be recorded) followed by the plcfpcd. Each block in the complex part is prefaced by a clxt (clx type), which is a 1-byte code, either 1 (meaning the block contains a grpprl) or 2 (meaning this is the plcfpcd). A clxtGrpprl (1) is followed by a 2-byte cb which is the count of bytes of the grpprl. A clxtPlcfpcd (2) is followed by a 4-byte lcb which is the count of bytes of the piece table. A full saved file will have no clxtGrpprl's. So the formats of the two types of blocks are:

clxt = 1 | clxtGrpprl
cb | count of bytes in grpprl
grpprl | see "Definitions" for description of grpprl; a grpprl can contain sprms modifying character, paragraph, table, section or picture properties

or

clxt = 2 | clxtPlcfpcd
lcb | count of bytes in piece table
plcfpcd | piece table

The entire CLX would look like this, depending on the number of grpprl's:

clxtGrpprl

cb

grpprl (0th grpprl)

clxtGrpprl

cb

grpprl (1st grpprl)

...

clxtPlcfpcd

cb

plcfpcd

When the prm in pcds stored in the plcfpcd, contains an igrpprl (index to a grpprl), the index stored is the order in which that grpprl was stored in the CLX.

© 1998 Microsoft Corporation. All rights reserved. Terms of use