'' This code is part of Document Solutions for Word demos.
'' Copyright (c) MESCIUS inc. All rights reserved.
Imports System.Drawing
Imports System.IO
Imports System.Linq
Imports GrapeCity.Documents.Word
Imports GrapeCity.Documents.Imaging

'' Demo of all built-in paragraph styles.
Public Class BuiltInParaStyles
    Public Function CreateDocx() As GcWordDocument
        Dim doc = New GcWordDocument()
        Dim pars = doc.Body.Paragraphs

        pars.Add("Demo of All Built-in Paragraph Styles", doc.Styles(BuiltInStyleId.Title))

        For Each id In [Enum].GetValues(GetType(BuiltInStyleId))
            If id = BuiltInStyleId.User Then
                Continue For
            End If
            Dim style = doc.Styles(id)
            If style.Type <> StyleType.Paragraph Then
                Continue For
            End If
            pars.Add($"Paragraph formatted using built-in paragraph style ' {style.Name}'.", style)

        '' Done
        Return doc
    End Function
End Class