Aspose::Words::Fields::FieldOptions::get_FieldIndexFormat method

FieldOptions::get_FieldIndexFormat method

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

Aspose::Words::Fields::FieldIndexFormat Aspose::Words::Fields::FieldOptions::get_FieldIndexFormat()

Examples

Shows how to formatting FieldIndex fields.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Write(u"A");
builder->InsertBreak(BreakType::LineBreak);
builder->InsertField(u"XE \"A\"");
builder->Write(u"B");

builder->InsertField(u" INDEX \\e \" · \" \\h \"A\" \\c \"2\" \\z \"1033\"", nullptr);

doc->get_FieldOptions()->set_FieldIndexFormat(FieldIndexFormat::Fancy);
doc->UpdateFields();

doc->Save(ArtifactsDir + u"Field.SetFieldIndexFormat.docx");

See Also