There’s no honour in working hard inefficiently. Only disgrace.
I read this somewhere on net. So I thought, why not make my daily chores like sorting and clearing my inbox more automated and less time consuming. Hence I wrote a code snippet that saved me a lot of time and effort. And moreover it made me happy everytime i ran the script. ;)
What the script does : It send all the mails in the folder "Nice" under "Inbox" to an email id of your choice and then deletes them from the folder "Nice".
Steps to set up this in your Outlook
1.) Goto Tools->Macros->Macros or Alt+F8
2.)Type Macro name as ExportToGmail and click on Create
3.)Microsoft Visual Basic Editor will open up.
4.)Copy paste the below code in the appopriate place for the Sub ExportToGmail()
==============================================
Sub ExportToGmail()
Dim objOutlook As New Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objInbox As MAPIFolder
Dim objConvHist As MAPIFolder
Dim objMail As MailItem
Dim myFolder As MAPIFolder
'Get the MAPI reference
Set objNameSpace = objOutlook.GetNamespace("MAPI")
'Pick up the Inbox
Set objInbox = objNameSpace.GetDefaultFolder(olFolderInbox)
Set myFolder = objInbox.Folders("Nice")
For Each Item In myFolder.Items
Set mailToSend = objInbox.Items.Add
With mailToSend
.Subject = Item.Subject
.Body = Item.Body
.To = "ABC@XYZ.com"
.Send
End With
Item.Delete
Next Item
MsgBox "Your mails from folder NICE are exported to Gmail", vbInformation, Oops
End Sub
===============================================
5. Change the (.To =) from ABC@XYZ.com to your mail id. and save the code. (Mail Id should be in double quotes)
6. Create folder called "Nice" below inbox in your outlook. If you want to change the name of the folder, change the entry in the code respectively.
7. Move all the emails that you want to export to the folder "Nice" .
8. Now go to Goto Tools->Macros->Macros or press Alt+F8
9. Click on the ExportToGmail() Macro in the list and click Run
If you want to use this macro regularly just let me know. I will explain how to create an icon on Outlook for the same. So that you can export all the mails in the folder just by a click of the mouse.
Tuesday, April 6, 2010
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2017
(1)
- ► December 2017 (1)
-
►
2013
(3)
- ► September 2013 (1)
- ► August 2013 (1)
-
►
2011
(7)
- ► November 2011 (3)
- ► October 2011 (1)
- ► August 2011 (1)
- ► April 2011 (1)
- ► January 2011 (1)
-
▼
2010
(28)
- ► November 2010 (1)
- ► October 2010 (6)
- ► September 2010 (2)
- ► August 2010 (3)
- ► March 2010 (2)
- ► February 2010 (4)
- ► January 2010 (2)
-
►
2009
(14)
- ► December 2009 (6)
- ► November 2009 (1)
- ► September 2009 (2)
- ► August 2009 (1)
- ► February 2009 (2)
- ► January 2009 (1)
-
►
2008
(12)
- ► December 2008 (1)
- ► October 2008 (3)
- ► August 2008 (2)
- ► February 2008 (4)
- ► January 2008 (1)
-
►
2007
(2)
- ► September 2007 (1)
- ► August 2007 (1)
-
►
2006
(1)
- ► November 2006 (1)
-
►
2001
(18)
- ► January 2001 (18)
No comments:
Post a Comment