DocumentPartName Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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; }Public Property DocumentPartName As StringExamples
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);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.