WordDocumentManager Class
Manager for handling Word documents in memory during AI agent operations. Provides document lifecycle management with automatic cleanup.
Implements
Inherited Members
Namespace: Syncfusion.AI.AgentTools.Word
Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
Syntax
public class WordDocumentManager : DocumentManagerBase<WordDocument>, IDocumentManager
Constructors
WordDocumentManager(Nullable<TimeSpan>)
Initializes a new instance of the WordDocumentManager class.
Declaration
public WordDocumentManager(Nullable<TimeSpan> expirationTime = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.TimeSpan> | expirationTime | Time before documents are automatically cleaned up. Default is 30 minutes. |
Properties
DocumentIdPrefix
Gets the prefix used for generating unique document identifiers.
Declaration
protected override string DocumentIdPrefix { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The prefix string "doc_" used for Word document IDs. |
Overrides
DocumentType
Gets the document type managed by this manager.
Declaration
public override DocumentType DocumentType { get; }
Property Value
| Type | Description |
|---|---|
| DocumentType | DocumentType.Word indicating this manager handles Word documents. |
Overrides
Methods
CloseDocument(WordDocument)
Closes and releases the resources associated with the Word document.
Declaration
protected override void CloseDocument(WordDocument document)
Parameters
| Type | Name | Description |
|---|---|---|
| WordDocument | document | The WordDocument instance to close. |
Overrides
CreateDocumentInstance()
Creates a new empty Word document instance.
Declaration
protected override WordDocument CreateDocumentInstance()
Returns
| Type | Description |
|---|---|
| WordDocument | A new WordDocument instance ready for editing. |
Overrides
Dispose()
Disposes the Word Document Manager and it's documents.
Declaration
public void Dispose()
ExportDocumentInstance(WordDocument, String)
Exports the Word document to the specified file path.
Declaration
protected override void ExportDocumentInstance(WordDocument document, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| WordDocument | document | The WordDocument instance to export. |
| System.String | filePath | The file path where the document will be saved. |
Overrides
ImportDocumentInstance(String)
Imports an existing Word document from the specified file path.
Declaration
protected override WordDocument ImportDocumentInstance(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file path to the Word document to load. |
Returns
| Type | Description |
|---|---|
| WordDocument | A WordDocument instance loaded from the specified file. |
Overrides
ImportDocumentInstance(String, String)
Imports an encrypted Word document from the specified file path using the provided password.
Declaration
protected override WordDocument ImportDocumentInstance(string filePath, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file path to the encrypted Word document. |
| System.String | password | The password required to open the encrypted document. |
Returns
| Type | Description |
|---|---|
| WordDocument | A WordDocument instance loaded from the specified file with decryption applied. |