Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Word "Find Whole Words Only" function! 2

Status
Not open for further replies.

Kjaa

Technical User
Feb 3, 2010
20
0
0
DK
Hey.

Im working as an IT Supporter trainee, and got an question that we have some problems resolving so Im writing here to you for help!

If you hit Ctrl + S i think on en EN keybord you get the Search function to appear in Word. Then you can click on that instead of searching some of the word, It need to search on the whole word, i will also show It on the attached Screenshot. The think I need Is: Are there In some way any possibilitiy that the function can be on as default when word starts up? I have tryed searching alot, but haven been able to finde anything.

Best Regards

Kristian Aa!
 
It is Ctrl+F to Find a word.
As far as setting search option defaults, I haven't been able to find help on it anywhere, however, I don't see why users would want some of those options set as default.
If you go into Word, hit Ctrl+F then click on More>> you will see an option to search for whole words only.
 
Okay I know how to get It to appear, but the only thing I need Is to finde a way to make It default on startup that It searches for whole words, I can't really tell you why someone want It. Just one at work that asked after It!

I have done some searching all over the internet to, and i haven't been able to find anything, or anything that says It can't be done!
 
My best suggestion in this predicament is to tell the user that Microsoft did not intend for it to be a default setting and that they will need to use it as is. Have them show you exactly why they need to do it. Maybe they are working on a 5 million page document and are looking for the one word. If not, then it's just a few extra clicks of a mouse to find the word.
Remember, there isn't always a solution for what people want, and it's our job to gracefully let the users know it.
Good luck!
 
The best you can do is perform a Find operation with MatchWholeWords checked, and then exit Find. Word retains the previous configuration, so the next time you do a Ctrl-F (A Find) Match Whole Words will be checked.

This only applies to the current session of Word. If you close Word and restart it, the default (Match Whole Words unchecked) applies.

Gerry
 
Although I do not recommend such a thing, you could of course also set the option with an auto_open macro in normal.dot.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
makeitso, do you have code that actually does that? I am having a very hard time finding instructions that actually set that option.

Gerry
 
Oopsy!
I probably should have revisited this thread. [blush]

Sorry Gerry!

What I meant was simply this here in an AutoExec macro in Normal.dot. Since this event fires before the first blank document is created, this here does it:
Code:
Sub AutoExec()
Documents.Add
DoEvents

With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .Replacement.Text = ""
    .MatchWildcards = False
    .MatchWholeWord = True
    .MatchCase = True
    .Execute
End With
End Sub
Put it in Normal.dot and there you go...
:)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
And there ya go. Kjaa, that is how you do it. Having that in your autoexec will force the Find dialog to have MatchWholeWord = True.

If during the current session of Word you do NOT want to have MatchWholeWord = True, simply uncheck it in the dialog.

Gerry
 
That sounds really good, I have been trying now to get it to work, and I can't really figure it out.

Is this the right way to do it?

Im searching for Normal.Dot, and edits it with the follow text you gave me. I save the document and thats that?

I have tryed saveing it as Normal.Dot, but it don't seem to stack when i open word ??

Best Regards
Kristian
 
@Kjaa:

Simply start Word. When opened, hit Alt+F11 to open the VB Editor.
In the left pane you will find the entry "Normal" on the very top.
Right click on it and say "Insert-->Module".
A module will be inserted and a blank white page opens in the right half of the window.
Paste the above code in its entirety.
Hit the save button.
Close Word.
Re-open it - tadaa...
:)


[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
@MakeItSo:

This is really awesome! Well done, and thanks for the help it's so nice to finally could do it :D

Many thanks ;)

Kristian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top