With BaseExtensions, we are able to perform a search for specific words, letter or characters to replace them with another specified word, letter or character. This feature is compatible in both PowerPoint Word. Read about Word solution here.
Module is located here:
...\ModuleLibrary\BaseExtensions\01_nocontext_Tools\44_WP_searchReplace.xml
In PowerPoint, we are also able to perform a search and replace with multiple parameters. Read about this syntax at the end of this article. This module is located here:
...\ModuleLibrary\BaseExtensions\01_nocontext_Tools\49_P_multipleSearchReplace.xml
CMD
<Cmd case="BaseExtensions:search-and-replace-pp" toSearch="x" toReplace="x" matchCase="x"/>
Parameters
toSearch
Define what the command should search for, e.g. "hi".
toReplace
Define what the toSearch
parameter should be replaced with, e.g. "hello".
This will search a document for "hi" and replace it everywhere with "hello".
Also, it is possible to use an expanded string where it targets a document property and inserts the value within. Here is an example:
<Cmd case="BaseExtensions:search-and-replace-pp" toSearch="[dupa]" toReplace="%CustProp|TestProp%"/>
In this case, [dupa] will be replace with the value within document property called TestProp.
matchCase
Define whether it should match on casing or not. This means, whether the search word should be written exactly in the parameter as in the presentation, where the command will search for it. If it should be exact match case, do not even out parameter. When defining the parameter to be false
, we are able to match the search word, even if some letters are upper in the presentation.
Here is an example:
<Cmd case="BaseExtensions:search-and-replace-pp" toSearch="hi" toReplace="hello" matchCase="false"/>
This command will replace every "hi" in the presentation, even if they are written like "HI", "Hi" or "hI".
disableAllCaps
Can be set to true
or false
. Defaults to false if omitted.
This parameter disables fields that are formatted with "ALL CAPS". Making sure that all words are spelled with the correct uppercase/lowercase format.
wholeWords
If false
, it has the old functionality. For example: if we want to replace "iman" to "imanage" it will find "iman" inside "imanage" and it will end up looking like "imanageage".
If true
- it only matches the whole word. Therefore the command will not find "iman" inside "imanage" if you were searching for "iman".
CMD for multiple searching
<Cmd case="BaseExtensions:search-and-replace-pp" multipleSearches="x" toSearch-1="x" toReplace-1="x" toSearch-2="x" toReplace-2="x"/>
Parameters
multipleSearches
Define parameter as true
to be able to perform multiple searches.
toSearch-X
As above, define what the command should search for. Here, the X must be replaced with 1, 2, 3 and so on, depending on the number of characters to search for.
toReplace-X
As above, define what the toSearch
parameter should be replaced with. Again, the X must be replaced with a number. For instance, if there is a parameter called toSearch-4
where the characters within should be replaced with "hello", the parameter toReplace-4
must be defined as "hello".
Comments
0 comments
Article is closed for comments.