# LoadSettings.DocumentPartName Property

> SpreadsheetML only. Gets or sets the name of the part of the document to be loaded. Each SpreadsheetML document can contain multiple named worksheets. This property can be used to select a certain worksheet. The LoadSettings.GetDocumentPartNames method returns a list of all worksheet names. When this property is null, which is the deafault value, the first worksheet in loaded. When this property is an empty string, a dialog box is opened showing the names of all worksheets the document contains. The end-user can then select the worksheet to be loaded.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 26.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 > LoadSettings.DocumentPartName Property
- **634 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/documentpartname-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/documentpartname-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/documentpartname-property/llms-full.txt

---

### Description

SpreadsheetML only. Gets or sets the name of the part of the document to be loaded. Each SpreadsheetML document can contain multiple named worksheets. This property can be used to select a certain worksheet. The [LoadSettings.GetDocumentPartNames](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/getdocumentpartnames-method/llms-full.txt) method returns a list of all worksheet names. When this property is null, which is the deafault value, the first worksheet in loaded. When this property is an empty string, a dialog box is opened showing the names of all worksheets the document contains. The end-user can then select the worksheet to be loaded.

### Syntax

```csharp
public string DocumentPartName { get; set; }
```

```vbnet
Public Property DocumentPartName As String
```

### Examples

The following example configures how a WordprocessingML template is loaded by using `LoadSettings.DocumentPartName`.

```csharp
LoadSettings loadSettings = new();

loadSettings.DocumentPartName = "CustomerName";
if (!string.IsNullOrWhiteSpace(loadSettings.DocumentPartName))
{
    Console.WriteLine($"Document Part Name: {loadSettings.DocumentPartName}");
}

textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);
```

```vbnet
Dim loadSettings As New LoadSettings()

loadSettings.DocumentPartName = "CustomerName"
If Not String.IsNullOrWhiteSpace(loadSettings.DocumentPartName) Then
    Console.WriteLine($"Document Part Name: {loadSettings.DocumentPartName}")
End If

textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings)
```

### Limitations

SpreadsheetML only.

---

## Nearby

- **Previous:** [LoadSettings.DocumentKeywords Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/documentkeywords-property/llms-full.txt)
- **Next:** [LoadSettings.DocumentSubject Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/documentsubject-property/llms-full.txt)
