BibliographyStylesProvider

FieldOptions.BibliographyStylesProvider property

Gets or sets a provider that returns a bibliography style for the FieldBibliography and FieldCitation fields.

public IBibliographyStylesProvider BibliographyStylesProvider { get; set; }

Examples

Shows how to override built-in styles or provide custom one.

public void ChangeBibliographyStyles()
{
    Document doc = new Document(MyDir + "Bibliography.docx");

    doc.FieldOptions.BibliographyStylesProvider = new BibliographyStylesProvider();
    doc.UpdateFields();

    doc.Save(ArtifactsDir + "Field.ChangeBibliographyStyles.docx");

}

public class BibliographyStylesProvider : IBibliographyStylesProvider
{
    Stream IBibliographyStylesProvider.GetStyle(string styleFileName)
    {
        return File.OpenRead(MyDir + "Bibliography custom style.xsl");
    }
}

See Also