Wednesday, December 12th, 2007...9:43 pm
Computer Prank - Spelling Bee
If you are new to the site, sign up for the RSS Feed. All new sign ups get punch and pieRSS feed. Thanks for visiting!
If you read my blog there is one thing you know for sure, I’m not going to win any spelling contest any time soon. I get comments all the time from the grammar/spelling police, ” Learn how to use spell check, dumb@$!@ “. I wrote this macro for those people. What this macro does is when ever you load word, it creates a custom dictionary. This custom dictionary contains common words, but misspelled. Whenever you type its correct equivalent it then misspells the word. This normally would have an big red squally line below but the custom dictionary takes care of that. The misspelled word now looks nice and perfect, because Word thinks its perfect. So how do you do it?
Step one
Open up Microsoft Word
Step two
Press alt f-11 ( This opens the code view )
Step three
Open your normal template. It is under Normal… Microsoft Word Objects… ThisDocument… Double click on this document
Step four
Copy the Code Below
Sub AutoExec()
Call WriteToATextFile
Dim dicCustom As Dictionary
Set dicCustom = Application.CustomDictionaries _
.Add(FileName:=“c:\customdic5.dic”)
Application.CustomDictionaries.ActiveCustomDictionary = dicCustomWith Application
CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeySpacebar), KeyCategory:=wdKeyCategoryCommand, _
Command:=“spellit”
End WithEnd Sub
Sub WriteToATextFile()
MyFile = “c:\customdic5.dic”
fnum = FreeFile()
Open MyFile For Output As fnum
Print #fnum, “teh”
Print #fnum, “Teh”
Close #fnum
End SubPublic Sub spellit()
Selection.TypeText Text:=“ ”
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = “the”
.Replacement.Text =“teh”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAllSelection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = “The”
.Replacement.Text =“Teh”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAllEnd Sub
Step5: Press Save
Step6: Close Word
Step7: Enjoy
If you have done this correctly you will now have a custom dictionary with misspellings galore. Every time they load word it will load this dictionary and the misspellings to get with it. Even if they were to delete the dictionary it self the code will recreate it every time.
Extras
To add more words then “TEH” there are few things you will have to do.
- Copy the line Print #fnum, “teh”
- Paste Print #fnum, “teh” right below where you copied it on to the next line
- The new line you just pasted Print #fnum, “teh” Change the word “teh” to what ever word you would like
- Next add the key change
- Copy the code
- Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = “the”
.Replacement.Text = “teh”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
- Selection.Find.ClearFormatting
- Paste the code below the code you just copied on the line below
- Change .Text=”the” and .Replacement.Text=”teh” with the original word and the word you want it to change to.
All done. You could make this more efficient but for simplicity sake we will just copy and paste.
How do you undo it?
Replace the code you put in originaly with this and click the run button
Computer Prank, Computer Tricks, Macro Prank, Microsoft, OFfICe prAnKs, Office Tricks, Prank Trick, Pranking, Prankster, Spelling Prank, Vba Prank, WOrd PrankFindKey(BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyA)).Clearapplication.CustomDictionaries.ClearAll
2 Comments
December 13th, 2007 at 8:08 am
Ironic you have a typo in you(r) instructions.
December 13th, 2007 at 10:27 am
@ Bendito:
He did say that he was a criminal of the grammar police though, at least he admits it.
Ha very good, can see this coming in handy at college sometime in the near future.
Leave a Reply