Get Started
Plugins
Macros
More information

Search and replace on start

Description

Searches for and replaces text in the document when it is reopened.

Plugin type: non-visual, system.

Supported editors: documents.

SearchAndReplaceOnStart
Installation

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

Usage
  1. Enter any text into the document (for this example it is ONLYOFFICE).
  2. In the plugin code enter the replacement text in replaceString parameter.
  3. Reopen the document.
Plugin structure

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

  1. config.json, index.html and code.js
  2. Icons
Config
{
    "name"       : "searchAndReplaceOnStart",
    "guid"       : "asc.{C820F3CC-1248-4CA2-8D0F-D7EFD44DE09C}",
    "baseUrl"    : "",
    "variations" : [
        {
            "description"         : "searchAndReplaceOnStart",
            "url"                 : "index.html",

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

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

            "initDataType"        : "none",
            "initData"            : "",

            "buttons"             : [],

            "events"              : ["onDocumentContentReady"]
        }
    ]
}
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.