DocumentBasePath Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Sets a base path saved in the document that is used to resolve relative file paths.
Syntax
public string DocumentBasePath { get; set; }Public Property DocumentBasePath As StringExamples
The following example resolves relative document resources against an application-owned assets directory. The configured base settings are then used by the appropriate load or save operation.
loadSaveSettingsBase.DocumentBasePath = Path.GetFullPath("DocumentAssets");
if (loadSaveSettingsBase is LoadSettings loadSettings)
{
textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);
}
else if (loadSaveSettingsBase is SaveSettings saveSettings)
{
textControl.Save("configured-document.docx", StreamType.WordprocessingML, saveSettings);
}loadSaveSettingsBase.DocumentBasePath = Path.GetFullPath("DocumentAssets")
If TypeOf loadSaveSettingsBase Is LoadSettings Then
textControl.Load("template.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, LoadSettings))
ElseIf TypeOf loadSaveSettingsBase Is SaveSettings Then
textControl.Save("configured-document.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, SaveSettings))
End If