# SectionCollection.Add Method

> Adds a new section to a document.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 14.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > SectionCollection.Add Method
- **1031 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectioncollection/add-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectioncollection/add-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectioncollection/add-method/llms-full.txt

---

### Description

Adds a new section to a document.

### Syntax

#### Add(SectionBreakKind)

Adds a new section at the current text input position. The new section ends at the end position of the section containing the input position. If a new section is inserted in a paragraph or table, the paragraph or table is split into two paragraphs or tables.

```csharp
public bool Add(SectionBreakKind sectionBreakKind);
```

```vbnet
Public Function Add(sectionBreakKind As SectionBreakKind) As Boolean
```

| Parameter | Description |
|---|---|
| sectionBreakKind | Specifies the kind of the section break. It can be one of the [SectionBreakKind](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectionbreakkind/enumeration/llms-full.txt) values. The following values are possible:  \| Value \| Meaning \| \| BeginAtNewLine \| The section begins on the next line with a new paragraph. \| \| BeginAtNewPage \| The section begins on the next page with a new paragraph. \| |
|---|

#### Add(SectionBreakKind, int)

Adds a new section at the specified text input position. The new section ends at the end position of the section containing the input position. If a new section is inserted in a paragraph or table, the paragraph or table is split into two paragraphs or tables.

```csharp
public bool Add(SectionBreakKind sectionBreakKind, int textPosition);
```

```vbnet
Public Function Add(sectionBreakKind As SectionBreakKind, textPosition As Integer) As Boolean
```

| Parameter | Description |
|---|---|
| sectionBreakKind | Specifies the kind of the section break. It can be one of the [SectionBreakKind](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectionbreakkind/enumeration/llms-full.txt) values. The following values are possible:  \| Value \| Meaning \| \| BeginAtNewLine \| The section begins on the next line with a new paragraph. \| \| BeginAtNewPage \| The section begins on the next page with a new paragraph. \| |
|---|

| textPosition | Specifies the text position at which the section is to be inserted. |
|---|---|

### Return Value

The return value is true, if the section could be added. Otherwise it is false.

### Examples

The following example starts a new page with an independent document section and enables landscape layout for that section.

```csharp
if (textControl.Sections.Add(SectionBreakKind.BeginAtNewPage, -1))
{
    Section newSection = textControl.Sections[textControl.Sections.Count];
    newSection.Format.Landscape = true;
}
```

```vbnet
If textControl.Sections.Add(SectionBreakKind.BeginAtNewPage, -1) Then
    Dim newSection As Section = textControl.Sections(textControl.Sections.Count)
    newSection.Format.Landscape = True
End If
```

---

## Nearby

- **Previous:** [SectionCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectioncollection/llms-full.txt)
- **Next:** [SectionCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/sectioncollection/copyto-method/llms-full.txt)
