# LoadSettings.GetDocumentPartNames Method

> SpreadsheetML only. Returns the names of all document parts the specified document contains. Each SpreadsheetML document can contain multiple named worksheets.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **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.GetDocumentPartNames Method
- **915 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/getdocumentpartnames-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/getdocumentpartnames-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/getdocumentpartnames-method/llms-full.txt

---

### Description

SpreadsheetML only. Returns the names of all document parts the specified document contains. Each SpreadsheetML document can contain multiple named worksheets.

### Syntax

#### GetDocumentPartNames(string, StreamType)

Gets the names of all document parts from the specified file.

```csharp
public static string[] GetDocumentPartNames(string path, StreamType streamType);
```

```vbnet
Public Shared Function GetDocumentPartNames(path As String, streamType As StreamType) As String()
```

| Parameter | Description |
|---|---|
| path | Specifies a file from which the document is loaded. |
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. Currently only StreamType.SpreadSheetML is supported. |

#### GetDocumentPartNames(byte\[\], StreamType)

Gets the names of all document parts from the specified byte array.

```csharp
public static string[] GetDocumentPartNames(byte[] binaryData, StreamType streamType);
```

```vbnet
Public Shared Function GetDocumentPartNames(binaryData As Byte(), streamType As StreamType) As String()
```

| Parameter | Description |
|---|---|
| binaryData | Specifies a byte array from which the document is loaded. |
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. Currently only StreamType.SpreadSheetML is supported. |

### Examples

The following example discovers named document parts in a WordprocessingML template before loading one.

```csharp
string[] partNames = LoadSettings.GetDocumentPartNames("template.docx", StreamType.WordprocessingML);
foreach (string partName in partNames)
{
    Console.WriteLine($"Document part: {partName}");
}
```

```vbnet
Dim partNames() As String = LoadSettings.GetDocumentPartNames("template.docx", StreamType.WordprocessingML)
For Each partName As String In partNames
    Console.WriteLine($"Document part: {partName}")
Next
```

### Limitations

SpreadSheetML only.

---

## Nearby

- **Previous:** [LoadSettings.EmbeddedData Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/embeddeddata-property/llms-full.txt)
- **Next:** [LoadSettings.ImageSearchPath Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/imagesearchpath-property/llms-full.txt)
