Tag Archives: email

Outlook Visual Basic For Applications (VBA)

Outlook: VBA code to display a random email from your inbox

Got loads of emails you need to action but don’t know where to start?  Run this outlook vba code or attach it to a menu item/button and it will display a randomly chosen email from your inbox.  I find this quite useful when I’m looking at the endless list of emails I don’t want to deal with – I just run the routine and make sure I deal with whatever email appears thrown at me.  It makes working through my email list more fun, too!

Sub ShowRandomEmails()

Dim myOLApp
Dim myNameSpace
Dim myFolder
Dim myItem

Set myOLApp = CreateObject("Outlook.Application")
Set myNameSpace = myOLApp.GetNamespace("MAPI")

Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

Dim intRandom
intRandom = Int(Rnd() * myFolder.Items.Count) + 1

Set myItem = myFolder.Items(intRandom)

End Sub

Life Random Web Links

Say goodbye from beyond the grave

I’m not quite sure if I like the concept behind www.greatgoodbye.com. I do, however think it would be hilarious to set up a few emails to be sent from beyond the grave to the people you didn’t like, or who didn’t like you whilst you were alive.  I could make a list soooo easily right now..