The search options are a collection of boolean values defining how the search parameter should be treated. Gets 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. Microsoft Word introduction comes in-built with default style templates like Title, Sub-Title, Heading1, Heading2, Body Text, Normal, etc. To apply a style to your text, select text and click on the chosen style in the command window. You can additionally right-click on the style and “modify” it as desired.
The Word Options menu allows you to customize Word 2007 according to your preferences. This article explains the available customization options.
In previous versions, this menu was located on the Tools menu (Tools > Preferences). In Word 2007, it is part of the Office menu.
To change user and software application preferences, follow these general steps:
The Options menu is quite extensive. It includes more than 100 modifiable options, not including submenus.
You can set preferences for AutoCorrect, printing, saving, custom dictionaries, color schemes, updating fields, and much more. In addition, this menu contains help options, such as repairing Microsoft Office, finding your product serial number, managing installed add-ins, and changing security settings.
If you hate the way Word 2007 does something, browse the Word Options menu to see if you can change it.
In this article, I discuss the tabs located in this menu, but I won’t be able to cover all of the available preferences you can set through this dialog. (If a topic is covered in more detail elsewhere on Word-Tips.com, I included a link.)
Let’s briefly explore the nine tabs located on the Word 2007 options menu.
The first five tabs contain commands for customizing Office and Word 2007:
If you use the Word Options menu on a regular basis, it saves time if you add it to the Quick Access toolbar.
It’s easy! Just follow these steps:
Now you don’t have to click the Office Button every time you want to change your preferences.
The last four tabs provide additional customization options, help, and resources for using Microsoft Office:
With so many customization options available, open the menu and spend time exploring each tab so you can see where your favorite user options are located. Setting up application and user preferences beforehand saves you time and frustration while you are working.
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.
The search options are a collection of boolean values defining how the search parameter should be treated.
Property | Description |
---|---|
ignorePunct | Gets 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. |
ignoreSpace | Gets 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. |
matchCase | Gets 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. |
matchPrefix | Gets 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. |
matchSuffix | Gets 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. |
matchWholeWord | Gets 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. |
matchWildcards | Gets 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. |
The following table provides guidance around the Word JavaScript API's search wildcards.
To find: | Wildcard | Sample |
---|---|---|
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. |
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.
The following examples demonstrate common scenarios.
More information can be found in the Word JavaScript Reference API.