Skip to main content
Automatic numbering for captions such as “Photo 1”, “Figure 2” or “Table 3”, as a Word sequence field.

Props

Names use letters, digits and underscores and start with a letter (Photo, Figura, Table_A).

Why a field

The number is a Word SEQ field, not fixed text. When someone inserts or deletes a numbered item in Word and updates fields (F9, printing, or on open with updateFieldsOnOpen), the numbers follow. A hard-coded Photo {index} would go stale after the first manual edit. React DOCX also writes the current number into the field, so the document reads correctly before any update and in viewers that never update fields.

Several sequences

Produces Figure 1, Table 1, Figure 2.