Style.BuiltIn property

True if this style is one of the built-in styles in MS Word.

public bool BuiltIn { get; }


Shows how to differentiate custom styles from built-in styles.

Document doc = new Document();

// When we create a document using Microsoft Word, or programmatically using Aspose.Words,
// the document will come with a collection of styles to apply to its text to modify its appearance.
// We can access these built-in styles via the document's "Styles" collection.
// These styles will all have the "BuiltIn" flag set to "true".
Style style = doc.Styles["Emphasis"];


// Create a custom style and add it to the collection.
// Custom styles such as this will have the "BuiltIn" flag set to "false". 
style = doc.Styles.Add(StyleType.Character, "MyStyle");
style.Font.Color = Color.Navy;
style.Font.Name = "Courier New";


See Also