Thursday, November 22nd, 2007...9:06 pm

Macro Pranks


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!


Here is another simple but annoying key binding prank. What this one will do is magnify the person’s word document to 500%, every time they press a certain letter. If you are really mean, you can bind multiple keys so they will have trouble narrowing down the problem. Steps are as follows

Step 1: Open Microsoft Word

Step2: Press Alt F11

Step3: Double click on the “this document” under the normal template

Step4: Copy this code

Sub AddKeyBinding()
With Application
CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyC), KeyCategory:=wdKeyCategoryCommand, _
Command:=”TestKeybinding”
End With
End Sub

Sub TestKeybinding()
Dim x As Document
Set x = ActiveDocument
ActiveDocument.ActiveWindow.View.Zoom.Percentage = 500
Selection.TypeText Text:=”c”
End Sub

Step 5: Save and Close

What this will do is when ever the letter “C” is typed it will increase the zoom to 500%. Easy to fix but very annoying. The key to this one is that the code types the letter C for them. That way they don’t catch on.

, , ,

StumbleUpon It!

12 Comments

  • Ooh this would be annoying…
    And different levels of zoom associated with random keys would be funny.

    *opens Word and starts messing with vba*

  • Yes it is very simple to add more zoom levels. Just change the Key and play with the code. If you know what your doing it would take 2 minutes

  • this is fckin pure evil man! I love it!

  • HAHA!, thats pretty epic.

    I’ll take any and every chance to sabotage a windows machine.

    long live the GNU revolution

    ….

    shut up im drunk. (o.o)

  • you can do similar things in OOo

  • I have tried these codes and they work well but after closing the Word they do not work anymore. How come? Tried on MS Office ‘03 and ‘07

  • Do these work on Macs? Because they’re not working for me… on a mac. I”m using microsoft word 2007

  • How to undo this prank? I deleted the code, but he can’t write the letter e now.

  • I’m having the same problem as Yellow, except with “c”. Any suggestions?

  • Hi - regarding the missing c and e’s.

    You should be able to find a working version of your normal.dot, normal.dotm in the following folder:

    C:\Documents and Settings\\Application Data\Microsoft\Templates

    You should be able to use one of the dot files in here. That will restore your missing letters.

    Cheers,
    -TDB

  • Alternatively, I believe you can use the Keybindings.ClearAll method as well to re-enable the “c” & “e” keys or any other key that was previously disabled….correct?

  • @Xiaichou

    You can do that but I tend to remove only the key binding I created. Because if you have any keybindings you want to still use it will clear those with it.

Leave a Reply