field_index_format property

FieldOptions.field_index_format property

Gets or sets a FieldOptions.field_index_format that represents the formatting for the FieldIndex fields in the document.

@property
def field_index_format(self) -> aspose.words.fields.FieldIndexFormat:
    ...

@field_index_format.setter
def field_index_format(self, value: aspose.words.fields.FieldIndexFormat):
    ...

Examples

Shows how to formatting FieldIndex fields.

doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
builder.write('A')
builder.insert_break(aw.BreakType.LINE_BREAK)
builder.insert_field(field_code='XE "A"')
builder.write('B')
builder.insert_field(field_code=' INDEX \\e " · " \\h "A" \\c "2" \\z "1033"', field_value=None)
doc.field_options.field_index_format = aw.fields.FieldIndexFormat.FANCY
doc.update_fields()
doc.save(file_name=ARTIFACTS_DIR + 'Field.SetFieldIndexFormat.docx')

See Also