TX Text Control .NET Server

GetDocumentPartNames Method

Method|Introduced in 26.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

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);
ParameterDescription
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);
ParameterDescription
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}");
}

Limitations

SpreadSheetML only.