GetDocumentPartNames Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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.
public static string[] GetDocumentPartNames(string path, StreamType streamType);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 values. Currently only StreamType.SpreadSheetML is supported. |
GetDocumentPartNames(byte[], StreamType)
Gets the names of all document parts from the specified byte array.
public static string[] GetDocumentPartNames(byte[] binaryData, StreamType streamType);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 values. Currently only StreamType.SpreadSheetML is supported. |
Examples
The following example discovers named document parts in a WordprocessingML template before loading one.
string[] partNames = LoadSettings.GetDocumentPartNames("template.docx", StreamType.WordprocessingML);
foreach (string partName in partNames)
{
Console.WriteLine($"Document part: {partName}");
}Dim partNames() As String = LoadSettings.GetDocumentPartNames("template.docx", StreamType.WordprocessingML)
For Each partName As String In partNames
Console.WriteLine($"Document part: {partName}")
NextLimitations
SpreadSheetML only.