From 8db4e834a82e42a26ed6acc22d52f9e24a080708 Mon Sep 17 00:00:00 2001 From: KirillovIlya Date: Mon, 13 Mar 2023 23:21:33 +0500 Subject: [PATCH] [de] Add a method to the plugins api to get the current word --- word/api_plugins.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/word/api_plugins.js b/word/api_plugins.js index 0e82694cf2..ec67d0d965 100644 --- a/word/api_plugins.js +++ b/word/api_plugins.js @@ -1159,6 +1159,23 @@ this.asc_setRestriction(_restrictions); }; + /** + * Get the current word + * @memberof Api + * @typeofeditors ["CDE"] + * @alias GetCurrentWord + * @since 7.3.3 + * @example + * window.Asc.plugin.executeMethod("GetCurrentWord"); + */ + window["asc_docs_api"].prototype["pluginMethod_GetCurrentWord"] = function() + { + let logicDocument = this.private_GetLogicDocument(); + if (!logicDocument) + return ""; + + return logicDocument.GetCurrentWord(); + }; function private_ReadContentControlCommonPr(commonPr) {