Top 10 List

Macro Pranks

  • Author: Iambetterthanu.com
  • Filed under: Computer Pranks
  • Date: Nov 22,2007

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.




private student loans


13 Responses for "Macro Pranks"

  1. Buzrael November 27th, 2007 at 7:50 am

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

    *opens Word and starts messing with vba*

  2. Jeff Dempsey November 27th, 2007 at 8:27 am

    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

  3. bLah November 28th, 2007 at 11:27 am

    this is fckin pure evil man! I love it!

  4. Robbie November 28th, 2007 at 8:26 pm

    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)

  5. scott November 29th, 2007 at 7:09 pm

    you can do similar things in OOo

  6. Jeff November 29th, 2007 at 7:15 pm

    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

  7. Miranda December 2nd, 2007 at 10:17 pm

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

  8. Yellow December 7th, 2007 at 4:45 am

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

  9. Yellow #2 December 11th, 2007 at 10:25 pm

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

  10. Traindabrain December 17th, 2007 at 12:08 pm

    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

  11. Xiaochou February 28th, 2008 at 7:36 am

    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?

  12. Jeff Dempsey February 28th, 2008 at 8:21 am

    @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.

  13. robin October 30th, 2008 at 8:40 am

    this is so cool. I cannt wait to pu this on my husband. thank you…


Leave a comment


Recent comments