TX Text Control .NET Server

DocumentPartName Property

Property|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. 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.

Syntax

public string DocumentPartName { get; set; }

Examples

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

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);

Limitations

SpreadsheetML only.