menu

Document Processing

Tab Class - C# Word Library API Reference | Syncfusion

    Show / Hide Table of Contents

    Tab Class

    Represents the tabs in the document.

    Inheritance
    System.Object
    OwnerHolder
    Syncfusion.DocIO.DLS.XML.XDLSSerializableBase
    Tab
    Inherited Members
    OwnerHolder.Document
    OwnerHolder.m_doc
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Base.dll
    Syntax
    public class Tab : XDLSSerializableBase, IXDLSSerializable
    Examples

    The following code example demonstrates how to modify the existing tab values in the document.

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create a new Word document
        WordDocument document = new WordDocument("Template.docx");
        //Add the section into Word document
        WSection section = document.AddSection() as WSection;
        //Access the first paragraph of the document
        WParagraph paragraph = document.Sections[0].Paragraphs[0];
        //Get the first tab from the paragraph 
        Tab tab = paragraph.ParagraphFormat.Tabs[0];
        //Adjust the tab values
        tab.Justification = TabJustification.Centered;
        tab.Position = 200;
        tab.TabLeader = Syncfusion.DocIO.DLS.TabLeader.Dotted;
        //Save and close the Word document instance
        document.Save("Sample.docx", FormatType.Docx);
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create a new Word document
       Dim document As New WordDocument("Template.docx")
       'Add the section into Word document
       Dim section As WSection = TryCast(document.AddSection(), WSection)
       'Access the first paragraph of the document
       Dim paragraph As WParagraph = document.Sections(0).Paragraphs(0)
       'Get the first tab from the paragraph 
       Dim tab As Tab = paragraph.ParagraphFormat.Tabs(0)
       'Adjust the tab values
       tab.Justification = TabJustification.Centered
       tab.Position = 200
       tab.TabLeader = Syncfusion.DocIO.DLS.TabLeader.Dotted
       'Save and close the Word document instance
       document.Save("Sample.docx", FormatType.Docx)
       document.Close()
    End Sub

    Properties

    DeletePosition

    Gets or sets the delete position for the tab measured in points.

    Declaration
    public float DeletePosition { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the delete position.

    Item[Int32]

    Gets or sets the key in property collection.

    Declaration
    protected object this[int key] { get; set; }
    Parameters
    Type Name Description
    System.Int32 key

    The integer that specifies the key.

    Property Value
    Type Description
    System.Object

    An object that specifies the key.

    Justification

    Gets or sets the TabJustification.

    Declaration
    public TabJustification Justification { get; set; }
    Property Value
    Type Description
    TabJustification

    The TabJustification member that specifies the tab justification of this Tab.

    Position

    Gets or sets the position of the tab measured in points.

    Declaration
    public float Position { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the position of tab.

    TabLeader

    Gets or sets the TabLeader.

    Declaration
    public TabLeader TabLeader { get; set; }
    Property Value
    Type Description
    TabLeader

    The TabLeader member that specifies the tab leader.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved