Tagged with " microsoft"
Dec 23, 2008 - tech, vba    6 Comments

Outlook VBA Code to Empty Deleted Items Folders

I’ve been working and playing around quite a bit with MS Excel and MS Outlook VBA code and have written quite a few tools / add-ins / functionality / macro code that automates several manual processes. Will try and add as many of these up as possible over time, starting today.

I have multiple personal folders (PSTs) in my MS Outlook profile and have rules set up to automatically move the emails to appropriate folders. When I delete an email, it is sent to the corresponding personal folder’s Deleted Items folder.

Now, MS Outlook has an ‘Empty “Deleted Items” Folder’ menu option, but that only empties the Deleted Items folder in the default mailbox and not the other personal folders. To empty these folders, one manually needs to right-click on each Deleted Items folder and click the ‘Empty “Deleted Items” Folder’ option.

Therefore I wrote this MS Outlook VBA macro code that is used to empty all the Deleted Items folders with one click.

You can download the code here.

To use this in your MS Outlook: Press ALT-F11 in MS Outlook to open the Microsoft Visual Basic editor. Macros need to be enabled and if Macros have not been enabled when you pressed ALT-F11, you will get a prompt to enable the same.

In the Project explorer on the left, right-click on Modules and Insert a new Module. Open the  text file that you downloaded above and copy-paste the code in the module.

To customise the code for your requirements, firstly figure out how many Personal Folders you have and their names.

Add the following code as many times as there are Personal Folders in your outlook profile, and replace “Friends” with your Personal Folder name:

‘***Empty Personal Folders Deleted Items Folder
‘Change the current folder to the target personal folder / pst name
Set personalFolder = mNameSpace.Folders(“Friends”) ‘Friends is the name of the Personal Folder
Set objExpl.CurrentFolder = personalFolder.Folders(“Deleted Items”)
‘Select the target folder
objExpl.SelectFolder personalFolder.Folders(“Deleted Items”)
‘Get the Empty Deleted Items command = UID 1671
Set objCBB = objExpl.CommandBars.FindControl(, 1671)
‘Execute the command
objCBB.Execute

At present the code has details of two Personal Folders (Friends and Family)

To run the above code you can press ALT-F8 (or go to Tools -> Macro -> Macros) and then select EmptyDeletedItems and click Run.

You may also add a shortcut button to the Toolbar, so you can run the macro in one click. For this right-click on the Toolbar and click on Customize. Click on the Commands tab and then select Macros as the Category and then drag and drop the EmptyDeletedItems macro command to a location on the Toolbar.

Running the macro now empties all the Deleted Items folders, in all the Personal Folders and the default Mailbox.

Download the code here.

Jan 13, 2007 - friends, microsoft, personal    7 Comments

Imagine a crime for a cup!

It’s safe enough to post the following now, of a crime committed long back, and it is time the world knows what happened that fateful night at Chennai where three aspiring students (lets call them Sha, Sun and Sab) had gone to participate in the Imagine Cup 2005, only for two of them to be betrayed by the third. This is a story of betrayal and back stabbing and of stealing a brilliant idea and also the code and other hardware rightly belonging to Sha and Sab – all for a prize at the Imagine Cup.

 

the criminal enters

The demented and jealous Sun enters as the unsuspecting Sab works hard on the comp

 

strike 1

Sun back stabbing poor Sab

 

aaaah help!!!

“Et tu Sun?….aaaahh!! help!!!” - Sha and Sab are shocked and scream for help…but alas…

 

strike 3

Sun then targets Sha and chokes him on the bed

 

strike 2

Sab is barely alive…and this time Sun goes for the throat

 

stealing intellectual property

Once Sab and Sha are out of the picture, Sun goes on to steal their code and ideas

 

caught in the act

As Sun is about to leave with some gadgets, he notices the camera capturing his every action

 

pretending to commit suicide

 A desperate Sun commits suicide in front of the camera…or did he?

 

No one knows what happened next…

Apart from these photos, nothing was recovered. No bodies. No code. No idea…

Wait a minute…the idea with quite a few modifications recently resurfaced at some distant land…could it be….??

 

Disclaimer: All characters are purely fictional and any resemblance to any person living or dead is purely coincidental.

Sep 26, 2006 - microsoft, personal    1 Comment

ooga mooga!

Ah well…its been ages since I blogged and so this random post from office with a random heading (dedicated to a friend from work ;)), while I sit doing major time pass waiting for some link to be restored with the onsite team, so that I can begin work again!

Office is good fun now, the pre-annual day events (cultural/sports/literary) are in full swing and as usual I’m in the middle of it all – In the organising committee and also managing the event portal and some of the events. Looks like nothing’s changed from school and college days, when I was in the organising committee for all the fest and other activities!

Hmmm…after a long time will be going for a Microsoft event again, this weekend at Hyderabad for the Microsoft Student Partner Meet (SPM). Should be good fun to meet all old champs and ambassadors and the new ones! The last SPM was held at Golden Palms Spa and Resort in Bangalore and was one helluva experience! Hopefully this one will be as good, if not better!

Well looks like the link is back again, so gotta rush!

Pages:1234567...17»