Microsoft Word Options On

-->Microsoft word alternatives for mac

Add-ins frequently need to act based on the text of a document.A search function is exposed by every content control (this includes Body, Paragraph, Range, Table, TableRow, and the base ContentControl object). This function takes in a string (or wildcard expression) representing the text you are searching for and a SearchOptions object. It returns a collection of ranges which match the search text.

With Microsoft 365 for the web (formally Office 365) you can edit and share Word, Excel, PowerPoint, and OneNote files on your devices using a web browser. Download Microsoft Word and enjoy it on your iPhone, iPad, and iPod touch. ‎The trusted Word app lets you create, edit, view, and share your files with others quickly and easily. Send, view and edit Office docs attached to emails from your phone with this powerful word processing app from Microsoft.

Word

Search options

The search options are a collection of boolean values defining how the search parameter should be treated.

PropertyDescription
ignorePunctGets or sets a value indicating whether to ignore all punctuation characters between words. Corresponds to the 'Ignore punctuation characters' check box in the Find and Replace dialog box.
ignoreSpaceGets or sets a value indicating whether to ignore all whitespace between words. Corresponds to the 'Ignore white-space characters' check box in the Find and Replace dialog box.
matchCaseGets or sets a value indicating whether to perform a case sensitive search. Corresponds to the 'Match case' check box in the Find and Replace dialog box.
matchPrefixGets or sets a value indicating whether to match words that begin with the search string. Corresponds to the 'Match prefix' check box in the Find and Replace dialog box.
matchSuffixGets or sets a value indicating whether to match words that end with the search string. Corresponds to the 'Match suffix' check box in the Find and Replace dialog box.
matchWholeWordGets or sets a value indicating whether to find operation only entire words, not text that is part of a larger word. Corresponds to the 'Find whole words only' check box in the Find and Replace dialog box.
matchWildcardsGets or sets a value indicating whether the search will be performed using special search operators. Corresponds to the 'Use wildcards' check box in the Find and Replace dialog box.

Wildcard guidance

The following table provides guidance around the Word JavaScript API's search wildcards.

To find:WildcardSample
Any single character?s?t finds sat and set.
Any string of characters*s*d finds sad and started.
The beginning of a word<<(inter) finds interesting and intercept, but not splintered.
The end of a word>(in)> finds in and within, but not interesting.
One of the specified characters[ ]w[io]n finds win and won.
Any single character in this range[-][r-t]ight finds right and sight. Ranges must be in ascending order.
Any single character except the characters in the range inside the brackets[!x-z]t[!a-m]ck finds tock and tuck, but not tack or tick.
Exactly n occurrences of the previous character or expression{n}fe{2}d finds feed but not fed.
At least n occurrences of the previous character or expression{n,}fe{1,}d finds fed and feed.
From n to m occurrences of the previous character or expression{n,m}10{1,3} finds 10, 100, and 1000.
One or more occurrences of the previous character or expression@lo@t finds lot and loot.

Escaping the special characters

Wildcard search is essentially the same as searching on a regular expression. There are special characters in regular expressions, including '[', ']', '(', ')', '{', '}', '*', '?', '<', '>', '!', and '@'. If one of these characters is part of the literal string the code is searching for, then it needs to be escaped, so that Word knows it should be treated literally and not as part of the logic of the regular expression. To escape a character in the Word UI search, you would precede it with a ' character, but to escape it programmatically, put it between '[]' characters. For example, '[*]*' searches for any string that begins with a '*' followed by any number of other characters.

Examples

The following examples demonstrate common scenarios.

Ignore punctuation search

Microsoft

Microsoft Word Options On Computer

Search based on a prefix

Search based on a suffix

Search using a wildcard

More information can be found in the Word JavaScript Reference API.

Microsoft Word Options Online

-->

Add-ins frequently need to act based on the text of a document.A search function is exposed by every content control (this includes Body, Paragraph, Range, Table, TableRow, and the base ContentControl object). This function takes in a string (or wildcard expression) representing the text you are searching for and a SearchOptions object. It returns a collection of ranges which match the search text.

Search options

The search options are a collection of boolean values defining how the search parameter should be treated.

PropertyDescription
ignorePunctGets or sets a value indicating whether to ignore all punctuation characters between words. Corresponds to the 'Ignore punctuation characters' check box in the Find and Replace dialog box.
ignoreSpaceGets or sets a value indicating whether to ignore all whitespace between words. Corresponds to the 'Ignore white-space characters' check box in the Find and Replace dialog box.
matchCaseGets or sets a value indicating whether to perform a case sensitive search. Corresponds to the 'Match case' check box in the Find and Replace dialog box.
matchPrefixGets or sets a value indicating whether to match words that begin with the search string. Corresponds to the 'Match prefix' check box in the Find and Replace dialog box.
matchSuffixGets or sets a value indicating whether to match words that end with the search string. Corresponds to the 'Match suffix' check box in the Find and Replace dialog box.
matchWholeWordGets or sets a value indicating whether to find operation only entire words, not text that is part of a larger word. Corresponds to the 'Find whole words only' check box in the Find and Replace dialog box.
matchWildcardsGets or sets a value indicating whether the search will be performed using special search operators. Corresponds to the 'Use wildcards' check box in the Find and Replace dialog box.

Wildcard guidance

The following table provides guidance around the Word JavaScript API's search wildcards.

To find:WildcardSample
Any single character?s?t finds sat and set.
Any string of characters*s*d finds sad and started.
The beginning of a word<<(inter) finds interesting and intercept, but not splintered.
The end of a word>(in)> finds in and within, but not interesting.
One of the specified characters[ ]w[io]n finds win and won.
Any single character in this range[-][r-t]ight finds right and sight. Ranges must be in ascending order.
Any single character except the characters in the range inside the brackets[!x-z]t[!a-m]ck finds tock and tuck, but not tack or tick.
Exactly n occurrences of the previous character or expression{n}fe{2}d finds feed but not fed.
At least n occurrences of the previous character or expression{n,}fe{1,}d finds fed and feed.
From n to m occurrences of the previous character or expression{n,m}10{1,3} finds 10, 100, and 1000.
One or more occurrences of the previous character or expression@lo@t finds lot and loot.

Escaping the special characters

Wildcard search is essentially the same as searching on a regular expression. There are special characters in regular expressions, including '[', ']', '(', ')', '{', '}', '*', '?', '<', '>', '!', and '@'. If one of these characters is part of the literal string the code is searching for, then it needs to be escaped, so that Word knows it should be treated literally and not as part of the logic of the regular expression. To escape a character in the Word UI search, you would precede it with a ' character, but to escape it programmatically, put it between '[]' characters. For example, '[*]*' searches for any string that begins with a '*' followed by any number of other characters.

Microsoft Word Options On Mac

Examples

The following examples demonstrate common scenarios.

Ignore punctuation search

Search based on a prefix

Search based on a suffix

Microsoft Word Alternatives For Mac

Search using a wildcard

Microsoft Word Alternatives For Android

More information can be found in the Word JavaScript Reference API.