[mso] Re: Outlook XP VBA help

Thomas--

1) In Outlook, go to 'Tools > Macros > Visual Basic Editor' and enter the
following code in the appropriate spot:

Sub EmptyActiveFolder()
    Dim lLoop As Long
    Dim objFolder As Outlook.MAPIFolder
    Set objFolder = Application.ActiveExplorer.CurrentFolder
    Dim objItems As Outlook.Items
    Set objItems = objFolder.Items
    If objFolder.Name = "Deleted Items" Then Exit Sub
    For lLoop = objItems.Count To 1 Step -1
        objItems.Item(lLoop).Delete
    Next
End Sub

2) Right click on a tool bar, hit 'Customise', select 'Macros' from the left
window, then drag and drop the EmptyActiveFolder macro onto an active
toolbar.

Note that this will *not* delete the contents of the "Deleted Items" folder
(that wouldn't be cool). It does delete all the items in the current folder
to the "Deleted Items" folder; it does not delete them permanently.

Hope this is what you were looking for.

--Jim

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Thomas N. Chan
Sent: Wednesday, July 27, 2005 15:48 PM
To: Microsoft Office
Subject: [mso] Outlook XP VBA help

Hi,
I would like to ask if anyone could help me in this area.
I am trying to create  a macro or a list of string which will issue the
following command  or things I wish it to do.
I got a folder which I wish to just click or shortcut key to empty the
content whether if its delete permanatly or just send it to the delete
folder which it will be empty by outlook if I close outlook.
So I been writing some codes in word, excel and access but never got any
experience with outlook.
And there's no record macro to help me to start something.
So could anyone give me some tips? Or what kind of things I should be typing
in?

thanks



Love can't be understand with just a flick of a finger or just a wink of a
little eye-lid  but its not as complicated as your worst subject in school

Best and regards,
Thomas N. Chan

Webpage: http://www.heartwarmers4u.com/members/?thomas
ICQ: 70375853
MSN Messenger: thomasnathan2001@xxxxxxxxxxx
SkyPe: aussie_thomas

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx
with the word "unsubscribe" (without the quotes) in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also
allow you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation
with instructions.  Once you are a member of the files group, you can go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: