Get Started
Plugins
Macros
More information

Search & replace

Description

Searches for target text and replaces it with something else.

Plugin type: visual, non-system, OLE-object.

Supported editors: documents.

SearchandReplace
Installation

Download this plugin from GitHub and install it following the desktop, on-premises, or cloud installation instructions.

Usage
  1. Insert the search text into the document (this text is in the array arrCodes in the plugin code).
  2. Open the Plugins tab and press Example of search and replace.
  3. Enter the text you want to replace each field with and press the Ok button.
Plugin structure

Repository on GitHub: https://github.com/ONLYOFFICE/sdkjs-plugins/tree/master/example_search_replace.

  1. config.json, index.html and code.js
  2. Icons
Config
{
    "name" : "Example of search and replace",
    "guid" : "asc.{5FF5F75F-2977-4B98-8D36-7C406D610B90}",

    "variations" : [
        {
            "description" : "Example of search and replace",
            "url"         : "index.html",

            "icons"           : ["icon.png", "icon@2x.png"],
            "isViewer"        : true,
            "EditorsSupport"  : ["word"],

            "isVisual"        : true,
            "isModal"         : true,
            "isInsideMode"    : false,

            "initDataType"    : "ole",
            "initData"        : "",

            "isUpdateOleOnResize" : true,

            "buttons"         : []
        }
    ]
}
Methods and events

The main plugin code is located here.

Support

If you want to request a feature or report a bug regarding this plugin, use the issues section on GitHub.