SPRM DEFINITIONS

A sprm is an instruction to modify one or more properties within one of the property defining data structures (CHP, PAP, TAP, SEP, or PIC). A sprm is a two-byte opcode at offset 0 which identifies the operation to be performed. If necessary information for the operation can always be expressed with a fixed length parameter, the fixed length parameter is recorded immediately after the opcode beginning at offset 2. The length of a fixed length sprm is always 2 plus the size of the sprm's parameter. If the parameter for the sprm is variable length, the count of bytes of the following parameter is stored in the byte at offset 2, followed by the parameter at offset 3.

Three sprms -- sprmPChgTabs , sprmTDefTable, and sprmTDefTable10 -- can be longer than 256 bytes. The method for calculating the length of sprmPChgTabs is recorded below with the description of the sprm. For sprmTDefTable and sprmTDefTable10, the length of the parameter plus 1 is recorded in the two bytes beginning at offset 2.

For all other variable length sprms, the total length of the sprm is the count recorded at offset 2 plus three (2 for the sprm + 1 for the count byte). The parameter immediately follows the count.

The sprm value encodes information on the size of the operand, the type of sprm (PAP, CHP, etc), and whether the sprm requires special handling (in cases where a property value isn't simply replaced).

sprm bits (0 = low)

Value

Details

0-8

ispmd

unique identifier within sgc group

9

fSpec

sprm requires special handling

10-12

sgc

sprm group; type of sprm (PAP, CHP, etc)

13-15

spra

size of sprm argument (see following table for values)


sgc value

type of sprm

1

PAP

2

CHP

3

PIC

4

SEP

5

TAP


spra value

operand size

0

1 byte (operand affects 1 bit)

1

1 byte

2

2 bytes

3

4 bytes

4

2 bytes

5

2 bytes

6

variable length -- following byte is size of operand

7

3 bytes


When parsing a grpprl, you can use the sprm's spra value to determine how many bytes are used by that sprm; it also enables you to skip over sprms you don't handle.

Unless otherwise noted, when a sprm is applied to a property the sprm's parameter changes the old value of the property in question to the value stored in the sprm parameter.

Name

sprm

Property Modified

Parameter

Parameter size

sprmPIstd

0x4600

pap.istd

istd (style code)

short

sprmPIstdPermute

0xC601

pap.istd

permutation vector (see below)

variable length

sprmPIncLvl

0x2602

pap.istd, pap.lvl

difference between istd of base PAP and istd of PAP to be produced (see below)

byte

sprmPJc

0x2403

pap.jc

jc (justification)

byte

sprmPFSideBySide

0x2404

pap.fSideBySide

0 or 1

byte

sprmPFKeep

0x2405

pap.fKeep

0 or 1

byte

sprmPFKeepFollow

0x2406

pap.fKeepFollow

0 or 1

byte

sprmPFPageBreakBefore

0x2407

pap.fPageBreakBefore

0 or 1

byte

sprmPBrcl

0x2408

pap.brcl

brcl

byte

sprmPBrcp

0x2409

pap.brcp

brcp

byte

sprmPIlvl

0x260A

pap.ilvl

ilvl

byte

sprmPIlfo

0x460B

pap.ilfo

ilfo (list index)

short

sprmPFNoLineNumb

0x240C

pap.fNoLnn

0 or 1

byte

sprmPChgTabsPapx

0xC60D

pap.itbdMac, pap.rgdxaTab, pap.rgtbd

complex - see below

variable length

sprmPDxaRight

0x840E

pap.dxaRight

dxa

word

sprmPDxaLeft

0x840F

pap.dxaLeft

dxa

word

sprmPNest

0x4610

pap.dxaLeft

dxa-see below

word

sprmPDxaLeft1

0x8411

pap.dxaLeft1

dxa

word

sprmPDyaLine

0x6412

pap.lspd

an LSPD, a long word structure consisting of a short of dyaLine followed by a short of fMultLinespace - see below

long

sprmPDyaBefore

0xA413

pap.dyaBefore

dya

word

sprmPDyaAfter

0xA414

pap.dyaAfter

dya

word

sprmPChgTabs

0xC615

pap.itbdMac, pap.rgdxaTab, pap.rgtbd

complex - see below

variable length

sprmPFInTable

0x2416

pap.fInTable

0 or 1

byte

sprmPFTtp

0x2417

pap.fTtp

0 or 1

byte

sprmPDxaAbs

0x8418

pap.dxaAbs

dxa

word

sprmPDyaAbs

0x8419

pap.dyaAbs

dya

word

sprmPDxaWidth

0x841A

pap.dxaWidth

dxa

word

sprmPPc

0x261B

pap.pcHorz, pap.pcVert

complex - see below

byte

sprmPBrcTop10

0x461C

pap.brcTop

BRC10

word

sprmPBrcLeft10

0x461D

pap.brcLeft

BRC10

word

sprmPBrcBottom10

0x461E

pap.brcBottom

BRC10

word

sprmPBrcRight10

0x461F

pap.brcRight

BRC10

word

sprmPBrcBetween10

0x4620

pap.brcBetween

BRC10

word

sprmPBrcBar10

0x4621

pap.brcBar

BRC10

word

sprmPDxaFromText10

0x4622

pap.dxaFromText

dxa

word

sprmPWr

0x2423

pap.wr

wr (see description of PAP for definition

byte

sprmPBrc

Top

0x6424

pap.brcTop

BRC

long

sprmPBrcLeft

0x6425

pap.brcLeft

BRC

long

sprmPBrcBottom

0x6426

pap.brcBottom

BRC

long

sprmPBrcRight

0x6427

pap.brcRight

BRC

long

sprmPBrcBetween

0x6428

pap.brcBetween

BRC

long

sprmPBrcBar

0x6629

pap.brcBar

BRC

long

sprmPFNoAutoHyph

0x242A

pap.fNoAutoHyph

0 or 1

byte

sprmPWHeightAbs

0x442B

pap.wHeightAbs

w

word

sprmPDcs

0x442C

pap.dcs

DCS

short

sprmPShd

0x442D

pap.shd

SHD

word

sprmPDyaFromText

0x842E

pap.dyaFromText

dya

word

sprmPDxaFromText

0x842F

pap.dxaFromText

dxa

word

sprmPFLocked

0x2430

pap.fLocked

0 or 1

byte

sprmPFWidowControl

0x2431

pap.fWidowControl

0 or 1

byte

sprmPRuler

0xC632

variable length

sprmPFKinsoku

0x2433

pap.fKinsoku

0 or 1

byte

sprmPFWordWrap

0x2434

pap.fWordWrap

0 or 1

byte

sprmPFOverflowPunct

0x2435

pap.fOverflowPunct

0 or 1

byte

sprmPFTopLinePunct

0x2436

pap.fTopLinePunct

0 or 1

byte

sprmPFAutoSpaceDE

0x2437

pap.fAutoSpaceDE

0 or 1

byte

sprmPFAutoSpaceDN

0x2438

pap.fAutoSpaceDN

0 or 1

byte

sprmPWAlignFont

0x4439

pap.wAlignFont

iFa (see description of PAP for definition)

word

sprmPFrameTextFlow

0x443A

pap.fVertical

pap.fBackward

pap.fRotateFont

complex (see description of PAP for definition)

word

sprmPISnapBaseLine

0x243B

obsolete: not applicable in Word97 and later versions

byte

sprmPAnld

0xC63E

pap.anld

variable length

sprmPPropRMark

0xC63F

pap.fPropRMark

complex (see below)

variable length

sprmPOutLvl

0x2640

pap.lvl

has no effect if pap.istd is < 1 or is > 9

byte

sprmPFBiDi

0x2441

pap.fBiDi

0 or 1

byte

sprmPFNumRMIns

0x2443

pap.fNumRMIns

1 or 0

bit

sprmPCrLf

0x2444

byte

sprmPNumRM

0xC645

pap.numrm

variable length

sprmPHugePapx

0x6645

see below

fc in the data stream to locate the huge grpprl (see below)

long

sprmPFUsePgsuSettings

0x2447

pap.fUsePgsuSettings

1 or 0

byte

sprmPFAdjustRight

0x2448

pap.fAdjustRight

1 or 0

byte

sprmCFRMarkDel

0x0800

chp.fRMarkDel

1 or 0

bit

sprmCFRMark

0x0801

chp.fRMark

1 or 0

bit

sprmCFFldVanish

0x0802

chp.fFldVanish

1 or 0

bit

sprmCPicLocation

0x6A03

chp.fcPic and chp.fSpec

see below

variable length, length recorded is always 4

sprmCIbstRMark

0x4804

chp.ibstRMark

index into sttbRMark

short

sprmCDttmRMark

0x6805

chp.dttmRMark

DTTM

long

sprmCFData

0x0806

chp.fData

1 or 0

bit

sprmCIdslRMark

0x4807

chp.idslRMReason

an index to a table of strings defined in Word 6.0 executables

short

sprmCChs

0xEA08

chp.fChsDiff and chp.chse

see below

3 bytes

sprmCSymbol

0x6A09

chp.fSpec, chp.xchSym and chp.ftcSym

see below

variable length, length recorded is always 4

sprmCFOle2

0x080A

chp.fOle2

1 or 0

bit

sprmCIdCharType

0x480B

obsolete: not applicable in Word97 and later versions

sprmCHighlight

0x2A0C

chp.fHighlight, chp.icoHighlight

ico (fHighlight is set to 1 iff ico is not 0)

byte

sprmCObjLocation

0x680E

chp.fcObj

FC

long

sprmCFFtcAsciSymb

0x2A10

sprmCIstd

0x4A30

chp.istd

istd, see styleshe