Add style for table

Hi,

I want to create a custom style for a table and add it to a word document. But it throws error like “Cannot create table styles”. My code is

    Dim builder1 As DocumentBuilder = New DocumentBuilder(wordDocument)
    Dim style As Aspose.Words.Tables.Table = Nothing
    style.Style = wordDocument.Styles.Add(StyleType.Table, "WKF_TableLetter_Style")
    With style.Rows(0).RowFormat
        .Borders.Top.LineStyle = Aspose.Words.LineStyle.Single
        .Borders.Vertical.LineStyle = Aspose.Words.LineStyle.Single
        .Borders.Horizontal.LineStyle = Aspose.Words.LineStyle.Single
        .Borders.Bottom.LineStyle = Aspose.Words.LineStyle.Single
        .Borders.Left.LineStyle = Aspose.Words.LineStyle.Single
        .Borders.Right.LineStyle = Aspose.Words.LineStyle.Single
        .AllowBreakAcrossPages = True
    End With

But same works fine for the paragraph. Below code works fine for paragraph.

    Dim doc As Document = New Document()
    Dim builder1 As DocumentBuilder = New DocumentBuilder(wordDocument)
    Dim style As Aspose.Words.Style = wordDocument.Styles.Add(StyleType.Paragraph, "WKF_TableLetter_Style")
    style.IsQuickStyle = True
    style.Font.Size = 24
    style.Font.SizeBi = 24
    style.Font.Name = "B Mitra"
    style.Font.NameBi = "B Mitra"
    builder1.ParagraphFormat.Style = style

Please kindly help me on this.

Regards,
Raj

@ashkmr42,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we have already logged this feature request as WORDSNET-5312 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

Currently, you can use any of built-in table styles and any table style defined within the template.

The issues you have found earlier (filed as WORDSNET-5312) have been fixed in this Aspose.Words for .NET 19.6 update and this Aspose.Words for Java 19.6 update.