A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Custom Action or Script to Purge Deleted Messages on IMAP account



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 8th 06, 07:30 PM posted to microsoft.public.outlook.program_vba
Frank M.
external usenet poster
 
Posts: 3
Default Custom Action or Script to Purge Deleted Messages on IMAP account

I have searched throughout the forums to find out how to automatically purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it), then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look back on
if necessary) and then to permanently DELETE it. This however does not remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB Scripting, but
that is beyond my capabilities / no good examples). If OUTLOOK had a MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a script
(or Custom Action) would get a LOT of thanks from dozens of people who have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan
Ads
  #2  
Old February 10th 06, 07:30 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Custom Action or Script to Purge Deleted Messages on IMAP account

Am Wed, 8 Feb 2006 11:30:19 -0800 schrieb Frank M.:

Frank, I never worked with IMAP but suppose this would work. For getting the
folder you could create a VBA method in ThisOutlookSession:

Public Sub Test()
With Application.Session.Pickfolder
Debug.Print "EntryID: " & .EntryID
Debug.Print "StoreID: " & .StoreID
End With
End Sub

Place the cursor into the method and press F5, then select the IMAP Inbox.
Open now the Direct Window (ctrl+g). It contains the folder´s IDs now.

The above method you can delete now and write the following code into
ThisOutlookSession instead:

Private Const IMAP_ENTRYID As String = "place the EntryID from the Direct
Window here"
Private Const IMAP_STOREID As String = "place the StoreID from the Direct
Window here"
Private Const DEL_BUTTON As Long = 0 ' Enter the Button´s ID here

Public Sub DeleteIMAP()
Dim oFld as Outlook.MapiFolder
Dim oCmd as Office.CommandBarButton

Set oFld = Application.Session _
.GetFolderFromID(IMAP_ENTRYID, IMAP_STOREID)
Set Application.ActiveExplorer.CurrentFolder = oFld

Set oCmd = Application.ActiveExplorer_
.CommandBars.FindControl(,DEL_BUTTON)
oCmd.Execute
End Sub

The only thing left for you is to get the Button´s ID (const DEL_BUTTON).
You could download OutlookSpy (www.dimastr.com) and search for the ID
comfortably.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I have searched throughout the forums to find out how to automatically

purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it), then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look back

on
if necessary) and then to permanently DELETE it. This however does not

remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB Scripting,

but
that is beyond my capabilities / no good examples). If OUTLOOK had a MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that

option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a

script
(or Custom Action) would get a LOT of thanks from dozens of people who

have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan

  #3  
Old February 10th 06, 05:19 PM posted to microsoft.public.outlook.program_vba
Frank M.
external usenet poster
 
Posts: 3
Default Custom Action or Script to Purge Deleted Messages on IMAP acco

Hi Michael.

Thank you for the information and programming. I almost got it…

I was able to find the ENTRYID, STOREID with your script, and BUTTON ID with
OUTSPY (although when I tried to get rid of OUTSPY.EXE, it corrupted Outlook;
I was not very pleased with what that programmer did but luckily I always
make a backup image before installing a shareware/freeware program and was
able to restore back before its installation).

I was able to create the following VB script:

---------
Private Const IMAP_ENTRYID As String = "00### DELETED FOR BREVITY 7F82800000"
Private Const IMAP_STOREID As String = "StoreID: 0000### DELETED FOR
BREVITY 400"
Private Const DEL_BUTTON As Long = 5583

Public Sub DeleteIMAP()
Dim oFld As Outlook.MAPIFolder
Dim oCmd As Office.CommandBarButton

Set oFld = Application.Session _
..GetFolderFromID(IMAP_ENTRYID, IMAP_STOREID)
Set Application.ActiveExplorer.CurrentFolder = oFld

Set oCmd = Application.ActiveExplorer_
..CommandBars.FindControl(,DEL_BUTTON)
oCmd.Execute
End Sub

-----

The first time I tried to run it, I received a security message about macros
being disabled. After changing the level to low and restarting OUTLOOK, I
tried to run it again, but it stopped at the following line with a yellow
line/arrow:

Public Sub DeleteIMAP()

After resetting and re-running it, it failed, placing the following line in
red and still pointing to the line above with a: “syntax error”
message box

..CommandBars.FindControl(,DEL_BUTTON)

Can you see what I did wrong? And is there a way to identify this marco as
‘trusted’ or signed so I can reset security to HIGH?

Thanks for your patience with me.

Frank





"Michael Bauer" wrote:

Am Wed, 8 Feb 2006 11:30:19 -0800 schrieb Frank M.:

Frank, I never worked with IMAP but suppose this would work. For getting the
folder you could create a VBA method in ThisOutlookSession:

Public Sub Test()
With Application.Session.Pickfolder
Debug.Print "EntryID: " & .EntryID
Debug.Print "StoreID: " & .StoreID
End With
End Sub

Place the cursor into the method and press F5, then select the IMAP Inbox.
Open now the Direct Window (ctrl+g). It contains the folder´s IDs now.

The above method you can delete now and write the following code into
ThisOutlookSession instead:

Private Const IMAP_ENTRYID As String = "place the EntryID from the Direct
Window here"
Private Const IMAP_STOREID As String = "place the StoreID from the Direct
Window here"
Private Const DEL_BUTTON As Long = 0 ' Enter the Button´s ID here

Public Sub DeleteIMAP()
Dim oFld as Outlook.MapiFolder
Dim oCmd as Office.CommandBarButton

Set oFld = Application.Session _
.GetFolderFromID(IMAP_ENTRYID, IMAP_STOREID)
Set Application.ActiveExplorer.CurrentFolder = oFld

Set oCmd = Application.ActiveExplorer_
.CommandBars.FindControl(,DEL_BUTTON)
oCmd.Execute
End Sub

The only thing left for you is to get the Button´s ID (const DEL_BUTTON).
You could download OutlookSpy (www.dimastr.com) and search for the ID
comfortably.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I have searched throughout the forums to find out how to automatically

purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it), then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look back

on
if necessary) and then to permanently DELETE it. This however does not

remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB Scripting,

but
that is beyond my capabilities / no good examples). If OUTLOOK had a MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that

option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a

script
(or Custom Action) would get a LOT of thanks from dozens of people who

have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan


  #4  
Old March 2nd 06, 04:35 PM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Custom Action or Script to Purge Deleted Messages on IMAP account

Am Wed, 8 Feb 2006 11:30:19 -0800 schrieb Frank M.:

Frank, I don´t have your latest post here and don´t want to use the web
interface. Anyway, here´s your solution:

Set oCmd = Application.ActiveExplorer _
..CommandBars.FindControl(,DEL_BUTTON)

Between the first row´s last word and the underline must be one blank space.
Instead you could also delete the underline and merge both rows into one
row.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I have searched throughout the forums to find out how to automatically

purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it), then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look back

on
if necessary) and then to permanently DELETE it. This however does not

remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB Scripting,

but
that is beyond my capabilities / no good examples). If OUTLOOK had a MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that

option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a

script
(or Custom Action) would get a LOT of thanks from dozens of people who

have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan

  #5  
Old March 3rd 06, 01:29 AM posted to microsoft.public.outlook.program_vba
Frank M.
external usenet poster
 
Posts: 3
Default Custom Action or Script to Purge Deleted Messages on IMAP acco

Michael,

That fixed it -- the macro runs and does the same thing as if I clicked on
the INBOX for IMAP.NET and then clicked the PURGE DELETED MESSAGES. It does
however have one undesrable behavior. After running it, it 'stays' in the
wrong Inbox folder (the one for the IMAP account). Is there a simple command
to tell it to come back to the primary INBOX folder, the one I have selected
as the default folder at startup?

Also, do you know how to make a macro a script or a custom action? In the
TOOLS, RULES and ALERTS, I do not have an option to execute a macro for when
mail arrives, only to 'run a script' or 'perform a custom action'. When I
go to either of these 'choices', they are blank.

Thanks again for your help.

Frank

"Michael Bauer" wrote:

Am Wed, 8 Feb 2006 11:30:19 -0800 schrieb Frank M.:

Frank, I don´t have your latest post here and don´t want to use the web
interface. Anyway, here´s your solution:

Set oCmd = Application.ActiveExplorer _
..CommandBars.FindControl(,DEL_BUTTON)

Between the first row´s last word and the underline must be one blank space.
Instead you could also delete the underline and merge both rows into one
row.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I have searched throughout the forums to find out how to automatically

purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it), then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look back

on
if necessary) and then to permanently DELETE it. This however does not

remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB Scripting,

but
that is beyond my capabilities / no good examples). If OUTLOOK had a MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that

option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a

script
(or Custom Action) would get a LOT of thanks from dozens of people who

have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan


  #6  
Old March 3rd 06, 05:24 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Custom Action or Script to Purge Deleted Messages on IMAP acco

Am Thu, 2 Mar 2006 17:29:28 -0800 schrieb Frank M.:

1)
With Application
Set .ActiveExplorer.CurrentFolder=.Session.GetdefaultF older(olFolderInbox)
End With

2) For the run-a-script rule the declaration must look like this:

Public Sub AnyName(oMail As Outlook.MailItem)
'...
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Michael,

That fixed it -- the macro runs and does the same thing as if I clicked

on
the INBOX for IMAP.NET and then clicked the PURGE DELETED MESSAGES. It

does
however have one undesrable behavior. After running it, it 'stays' in the
wrong Inbox folder (the one for the IMAP account). Is there a simple

command
to tell it to come back to the primary INBOX folder, the one I have

selected
as the default folder at startup?

Also, do you know how to make a macro a script or a custom action? In the
TOOLS, RULES and ALERTS, I do not have an option to execute a macro for

when
mail arrives, only to 'run a script' or 'perform a custom action'. When

I
go to either of these 'choices', they are blank.

Thanks again for your help.

Frank

"Michael Bauer" wrote:

Am Wed, 8 Feb 2006 11:30:19 -0800 schrieb Frank M.:

Frank, I don´t have your latest post here and don´t want to use the web
interface. Anyway, here´s your solution:

Set oCmd = Application.ActiveExplorer _
..CommandBars.FindControl(,DEL_BUTTON)

Between the first row´s last word and the underline must be one blank

space.
Instead you could also delete the underline and merge both rows into one
row.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I have searched throughout the forums to find out how to automatically

purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail

from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it),

then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look

back
on
if necessary) and then to permanently DELETE it. This however does not

remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB

Scripting,
but
that is beyond my capabilities / no good examples). If OUTLOOK had a

MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that

option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP

account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a

script
(or Custom Action) would get a LOT of thanks from dozens of people who

have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan


  #7  
Old June 24th 06, 10:47 PM posted to microsoft.public.outlook.program_vba
John
external usenet poster
 
Posts: 382
Default Custom Action or Script to Purge Deleted Messages on IMAP acco

Knowing that this post is old, I am posting my version of this macro. I know
I came accross this thread months later, and it helped me..... so to expand
on this:

This macro will save you all the trouble of the above discoveries. It will
step through all your MAPI folders and purge all deleted email from the
Inboxes.

This is the first macro I wrote for Outlook, and I just pieced it together
from the previous posters, and the help texts. It's really dirty, in that I
haven't done the usual declarations, but it works well.

Things to do:
1. I need to clean it up (a lot!)
2. I want to make it remember which folder I started out, and return me to
that same folder. Currently, it returns you to the default folder.

Public Sub PurgeAllInboxes()
Dim PURGE_BUTTON As Long
PURGE_BUTTON = 5583

'Create a pointer to the application
Set myOlApp = CreateObject("Outlook.Application")
'Get the root namespace
Set myNameSpace = myOlApp.GetNamespace("MAPI")

'How many top level folders? (accounts plus Personal Folder)
FolderCount = myNameSpace.Folders.Count

'Step through the folders
For i = 1 To FolderCount
'Select the folder
Set myFolder = myNameSpace.Folders(i)
'Select the Inbox of this top level folder
Set myNewFolder = myFolder.Folders("Inbox")
'Make this the active folder to execute a command upon
Set Application.ActiveExplorer.CurrentFolder = myNewFolder
'Setup the command
Set oCmd = Application.ActiveExplorer.CommandBars.FindControl (,
PURGE_BUTTON)
oCmd.Execute
Next i

'Return to the default folder when finished
With Application
Set .ActiveExplorer.CurrentFolder =
..Session.GetDefaultFolder(olFolderInbox)
End With

End Sub

  #8  
Old June 24th 06, 10:56 PM posted to microsoft.public.outlook.program_vba
John
external usenet poster
 
Posts: 382
Default Custom Action or Script to Purge Deleted Messages on IMAP acco

Ok, here's the update where the macro returns to the folder you were in when
you ran the macro.

Still have to clean this up, of course.
--------------------------------------------------------------
Public Sub PurgeAllInboxes()
Dim PURGE_BUTTON As Long
PURGE_BUTTON = 5583

'Create a pointer to the application
Set myOlApp = CreateObject("Outlook.Application")
'Get the root namespace
Set myNameSpace = myOlApp.GetNamespace("MAPI")

'Remember which folder we stared out in
CurrentFolder = Application.ActiveExplorer.CurrentFolder

'How many top level folders? (accounts plus Personal Folder)
FolderCount = myNameSpace.Folders.Count

'Step through the folders
For i = 1 To FolderCount
'Select the folder
Set myFolder = myNameSpace.Folders(i)
'Select the Inbox of this top level folder
Set myNewFolder = myFolder.Folders("Inbox")
'Make this the active folder to execute a command upon
Set Application.ActiveExplorer.CurrentFolder = myNewFolder
'Setup the command
Set oCmd = Application.ActiveExplorer.CommandBars.FindControl (,
PURGE_BUTTON)
oCmd.Execute
Next i

'Return to the default folder when finished
With Application
Set .ActiveExplorer.CurrentFolder = CurrentFolder
End With

End Sub

  #9  
Old November 28th 06, 03:12 PM posted to microsoft.public.outlook.program_vba
Dirk
external usenet poster
 
Posts: 7
Default Custom Action or Script to Purge Deleted Messages on IMAP acco

Michael,

Because I had the same problem I used your code and adapted if for my use.
This is the code I used

Public Const DIRK_IMAP_ENTRYID As String =
"00000000BB9DBA9F97320D489CC84636406E960A82800 000"
Public Const DIRK_IMAP_STOREID As String =
"0000000038A1BB1005E5101AA1BB08002B2A56C2000070737 47072782E646C6C00000000000000004E495441F9BFB80100A A0037D96E000000443A5C446F63756D656E747320616E64205 3657474696E67735C64766572736C79705C4C6F63616C20536 57474696E67735C4170706C69636174696F6E20446174615C4 D6963726F736F66745C4F75746C6F6F6B5C4F75746C6F6F6B3 1302E322E33302E3230332D30303030303031362E70737400"
Public Const KANTOOR_IMAP_ENTRYID As String =
"00000000C4BB3B626D71B343A78BAE204409B51482800 000"
Public Const KANTOOR_IMAP_STOREID As String =
"0000000038A1BB1005E5101AA1BB08002B2A56C2000070737 47072782E646C6C00000000000000004E495441F9BFB80100A A0037D96E000000443A5C446F63756D656E747320616E64205 3657474696E67735C64766572736C79705C4C6F63616C20536 57474696E67735C4170706C69636174696F6E20446174615C4 D6963726F736F66745C4F75746C6F6F6B5C4F75746C6F6F6B4 F6E7476616E676B616E746F6F7220576576656C67656D2D303 03030303031352E70737400"
Public Const DEL_BUTTON As Long = 5583 ' Enter the Button´s ID here

Public Sub DeleteIMAPDIRK()
Dim oFld As Outlook.MAPIFolder
Dim oCmd As Office.CommandBarButton

Set oFld = Application.Session.GetFolderFromID(DIRK_IMAP_ENTR YID,
DIRK_IMAP_STOREID)
Set Application.ActiveExplorer.currentFolder = oFld

Set oCmd = Application.ActiveExplorer.CommandBars.FindControl (, DEL_BUTTON)
oCmd.Execute
MsgBox "dirk uitgevoerd"
End Sub


Public Sub DeleteIMAPKANTOOR()
Dim oFld As Outlook.MAPIFolder
Dim oCmd As Office.CommandBarButton

Set oFld = Application.Session.GetFolderFromID(KANTOOR_IMAP_E NTRYID,
KANTOOR_IMAP_STOREID)
Set Application.ActiveExplorer.currentFolder = oFld

Set oCmd = Application.ActiveExplorer.CommandBars.FindControl (, DEL_BUTTON)
oCmd.Execute
MsgBox "kantoor uitgevoerd"
End Sub


Public Sub PurgeDeletedItemsIMAPDIRK(oItem As Outlook.MailItem)
Call DeleteIMAPDIRK
End Sub


Public Sub PurgeDeletedItemsIMAPKANTOOR(oItem As Outlook.MailItem)
Call DeleteIMAPKANTOOR
End Sub

I used the last two subs in rules, in the following way :
when the email is received, the rule moves a copy of it in a folder I
created and after that I let the script run (using one of the two last
subroutines).

When I do this the code in these subs is effectively run (the messagebox is
displayed) but the items marked for deletion or NOT purged. However when I
run the macro that is called in these subroutines - outside of the rules - it
does work fine. But why are these items not deleted when running the script
from within the rules ? Have You got any idea ? i'm working with outlook 2003

PS : excuse me if my english isn't all that good, because it's not my
language (I'm from Belgium). I hope you understand my problem

"Michael Bauer" wrote:

Am Thu, 2 Mar 2006 17:29:28 -0800 schrieb Frank M.:

1)
With Application
Set .ActiveExplorer.CurrentFolder=.Session.GetdefaultF older(olFolderInbox)
End With

2) For the run-a-script rule the declaration must look like this:

Public Sub AnyName(oMail As Outlook.MailItem)
'...
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Michael,

That fixed it -- the macro runs and does the same thing as if I clicked

on
the INBOX for IMAP.NET and then clicked the PURGE DELETED MESSAGES. It

does
however have one undesrable behavior. After running it, it 'stays' in the
wrong Inbox folder (the one for the IMAP account). Is there a simple

command
to tell it to come back to the primary INBOX folder, the one I have

selected
as the default folder at startup?

Also, do you know how to make a macro a script or a custom action? In the
TOOLS, RULES and ALERTS, I do not have an option to execute a macro for

when
mail arrives, only to 'run a script' or 'perform a custom action'. When

I
go to either of these 'choices', they are blank.

Thanks again for your help.

Frank

"Michael Bauer" wrote:

Am Wed, 8 Feb 2006 11:30:19 -0800 schrieb Frank M.:

Frank, I don´t have your latest post here and don´t want to use the web
interface. Anyway, here´s your solution:

Set oCmd = Application.ActiveExplorer _
..CommandBars.FindControl(,DEL_BUTTON)

Between the first row´s last word and the underline must be one blank

space.
Instead you could also delete the underline and merge both rows into one
row.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I have searched throughout the forums to find out how to automatically
purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail

from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it),

then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look

back
on
if necessary) and then to permanently DELETE it. This however does not
remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB

Scripting,
but
that is beyond my capabilities / no good examples). If OUTLOOK had a

MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that
option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP

account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a
script
(or Custom Action) would get a LOT of thanks from dozens of people who
have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan


  #10  
Old July 10th 09, 06:44 PM posted to microsoft.public.outlook.program_vba
BP1973
external usenet poster
 
Posts: 3
Default Custom Action or Script to Purge Deleted Messages on IMAP account

Hello Frank,
THis is a very old posting but I though I would check to see if you can help
since I see you found a solution for one of my questions.
Can you share the steps t create a rule to copy a message to the IMAP
DELETED FOLDER?

I would really really appreciate it!



"Frank M." wrote:

I have searched throughout the forums to find out how to automatically purge
deleted messages in an IMAP account but only found a lot of talk of how
Microsoft has not made that option part of Outlook.

I have created three rules (in succession) that first copy the mail from
the IMAP INBOX to the PERSONAL FOLDERS INBOX (so my PDA can see it), then
copy the message to my IMAP DELETED FOLDER (so I have a copy to look back on
if necessary) and then to permanently DELETE it. This however does not remove
it from my IMAP server INBOX unless I click on PURGE DELETED MESSAGES.

I see there are options in MAIL RULES to either: RUN SCRIPT or PERFORM
CUSTOM ACTION. Unfortunately, when I searched HELP ONLINE there is very
little about either of these (well, there is a lot on using VB Scripting, but
that is beyond my capabilities / no good examples). If OUTLOOK had a MACRO
CREATOR (like EXCEL), I could probably do it, but I do not see that option.

Has any one written a script or custom action that could be used? In
essence, all it needs to do is select the INBOX folder of the IMAP account
and do a 'click' on the PURGE MESSAGES icon. Anyone who wrote such a script
(or Custom Action) would get a LOT of thanks from dozens of people who have
the same need as me.

Anyone know how to do it?

Thanks.

Frank in Michigan

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up an IMAP account Crockett Outlook - Installation 14 May 30th 06 03:01 PM
Outlook: Auto-purge via IMAP. thekman Outlook - Installation 1 February 21st 06 04:27 PM
How to Copy a Custom Action bowen Add-ins for Outlook 0 February 20th 06 05:10 AM
How to copy a custom action bowen Outlook - Using Forms 0 February 20th 06 05:10 AM
Recover deleted messages after emptying deleted items folder Gail Outlook Express 2 January 30th 06 05:18 PM


All times are GMT +1. The time now is 04:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright Š2004-2024 Outlook Banter.
The comments are property of their posters.