alexa
menu

Document Processing

    Show / Hide Table of Contents

    WordBookmarkAgentTools Class

    Provides agent tools for bookmark management in Word documents. Handles bookmark operations including content extraction, replacement, and deletion.

    Inheritance
    System.Object
    AgentToolBase
    AgentToolBase<WordDocument>
    WordBookmarkAgentTools
    Inherited Members
    AgentToolBase<WordDocument>.InMemoryManager
    AgentToolBase<WordDocument>.Mode
    AgentToolBase<WordDocument>.OpenDocument(String, String)
    AgentToolBase<WordDocument>.SaveDocument(String, WordDocument)
    AgentToolBase<WordDocument>.SaveFile(String, Stream)
    AgentToolBase<WordDocument>.StorageManager
    AgentToolBase.GetTools()
    Namespace: Syncfusion.AI.AgentTools.Word
    Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
    Syntax
    public class WordBookmarkAgentTools : AgentToolBase<WordDocument>

    Constructors

    WordBookmarkAgentTools(DocumentStorageManager)

    Initializes a new instance of the WordBookmarkAgentTools class (Mode 2 — DocumentStorage).

    Declaration
    public WordBookmarkAgentTools(DocumentStorageManager manager)
    Parameters
    Type Name Description
    DocumentStorageManager manager

    The document storage manager.

    WordBookmarkAgentTools(WordDocumentManager)

    Initializes a new instance of the WordBookmarkAgentTools class (Mode 1 — InMemory).

    Declaration
    public WordBookmarkAgentTools(WordDocumentManager manager)
    Parameters
    Type Name Description
    WordDocumentManager manager

    The document manager for managing Word documents.

    Methods

    GetBookmarkContent(String, String)

    Gets content from the specified bookmark and creates a new document with that content.

    Declaration
    [Tool(Name = "GetBookmarkContent", Description = "Get content from the bookmark. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode). Returns the document id of new document created for bookmark content.")]
    public AgentToolResult GetBookmarkContent([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode)")] string documentIdOrFilePath, [ToolParameter(Description = "The name of the bookmark")] string bookmarkName)
    Parameters
    Type Name Description
    System.String documentIdOrFilePath

    The document ID (InMemory mode) or the input presentation file path (DocumentStorage mode).

    System.String bookmarkName

    The name of the bookmark from which content will be extracted.

    Returns
    Type Description
    AgentToolResult

    Result containing the document ID of the newly created document with the extracted bookmark content.

    GetBookmarks(String)

    Gets all bookmark names from the Word document.

    Declaration
    [Tool(Name = "GetBookmarks", Description = "Gets all bookmark names from the Word document. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode). Returns the collection of all bookmark names.")]
    public AgentToolResult GetBookmarks([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode)")] string documentIdOrFilePath)
    Parameters
    Type Name Description
    System.String documentIdOrFilePath

    The document ID (InMemory mode) or the input presentation file path (DocumentStorage mode).

    Returns
    Type Description
    AgentToolResult

    A collection of all bookmark names found in the document.

    RemoveBookmark(String, String, String)

    Removes the specified bookmark from the Word document.

    Declaration
    [Tool(Name = "RemoveBookmark", Description = "Removes the specified bookmark from the Word document. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode).")]
    public AgentToolResult RemoveBookmark([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode)")] string documentIdOrFilePath, [ToolParameter(Description = "The name of the bookmark")] string bookmarkName, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
    Parameters
    Type Name Description
    System.String documentIdOrFilePath

    The document ID (InMemory mode) or the input presentation file path (DocumentStorage mode).

    System.String bookmarkName

    The name of the bookmark to be removed from the document.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure of the bookmark removal operation.

    RemoveBookmarkContent(String, String, String)

    Removes the content of the specified bookmark in the Word document.

    Declaration
    [Tool(Name = "RemoveBookmarkContent", Description = "Removes the content of the specified bookmark in the Word document. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode).")]
    public AgentToolResult RemoveBookmarkContent([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode)")] string documentIdOrFilePath, [ToolParameter(Description = "The name of the bookmark")] string bookmarkName, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
    Parameters
    Type Name Description
    System.String documentIdOrFilePath

    The document ID (InMemory mode) or the input presentation file path (DocumentStorage mode).

    System.String bookmarkName

    The bookmark for which content will be removed.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure of the bookmark content removal operation.

    ReplaceBookmarkContent(String, String, String, String)

    Replaces the existing bookmark content with content from another document.

    Declaration
    [Tool(Name = "ReplaceBookmarkContent", Description = "Replaces the existing bookmark content with content from another document. documentIdOrFilePath: The document ID (InMemory mode) or input file path (DocumentStorage mode).")]
    public AgentToolResult ReplaceBookmarkContent([ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode) containing the bookmark")] string documentIdOrFilePath, [ToolParameter(Description = "The name of the bookmark")] string bookmarkName, [ToolParameter(Description = "The document ID (InMemory mode) or input file path (DocumentStorage mode) to replace with")] string replaceDocumentIdOrFilePath, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
    Parameters
    Type Name Description
    System.String documentIdOrFilePath

    The document ID (InMemory mode) or the input presentation file path (DocumentStorage mode).

    System.String bookmarkName

    The name of the bookmark whose content will be replaced.

    System.String replaceDocumentIdOrFilePath

    The document ID or file path containing the replacement content.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure of the bookmark content replacement operation.

    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved