Problem with simple script with IMAP account

  • Thread starter Thread starter Adam Lang
  • Start date Start date
A

Adam Lang

The only thing keeping a number of people in my company from using
IMAP instead of POP for their email access on Outlook is the way
Outlook handles deletion of email messages when using IMAP. (Keep
the message in place, put a line through it). MAPI isn't a possibility for
these people, for various reasons.

I set out to write a macro that would, when executed, take the currently
selected message or messages and move them to another folder in the
IMAP account, a folder called 'Trash'. This wasn't difficult, and works
fine for MAPI and POP accounts. However, when you do this on the
IMAP account, it makes a copy of the message in the target folder, but
then LEAVES the original in the original folder, WITH A LINE THROUGH
IT. Which is exactly what I'm trying to avoid.

This is using the 'Move' method, not some kind of odd create-delete
duo. And it's very clearly a bug, since you're certainly supposed to be
able to move messages around in the IMAP protocol. It is *almost*
stupid enough to feel intentional: they like the fact that nobody can
stand to use IMAP with Outlook, and so simple workarounds just
happen to fail.

Regardless, I'm still looking for a way to make this work. If I try to
'Delete' a message with a line through it, nothing happens. If I try the
'Move', nothing happens. There does not appear to be any 'Purge'
method in the parent folder object, so you can't just purge deleted
messages every time this happens. There isn't a purge or 'really delete'
or expunge or whatever method in the message's object.

Can anybody think of a workaround? Is there some way to tell Outlook
via a macro to select a certain menu item? (lPurge Deleted Messages')
Is there some way I'm not seeing to move an IMAP item without leaving
the residual message? Is there at least someplace I can REPORT this as
a bug?

Basically, MAPI doesn't work correctly in anything but the most
absolutely perfect conditions. POP doesn't leave a copy on the server,
thus ensuring that at least one person a month loses all of his or her
email to a system crash. IMAP is too irritating to be used, what with
our email at some addresses (after filtering) being more than 50%
SPAM. 'Alternative' (fake) outlook servers like Binari are hideous
monstrosities that cause an order of magnitude more problems than
they solve. And nobody is willing to use an email client other than
Outlook.

Makes me wonder why I didn't just STAY unemployed.

--Adam Lang
 
Yes, you can use CommandBars and the
CommandBarControl.Execute method to run any Outlook menu
or toolbar command, in this case the Purge Deleted
Messages command, whose ID is 5583. THe Help topics on
those methods and objects should get you pointed in the
right direction.

YOu can, BTW, configure POP to leave a copy of messages
on the server.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at
http://www.slipstick.com
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers

-----Original Message-----
The only thing keeping a number of people in my company from using
IMAP instead of POP for their email access on Outlook is the way
Outlook handles deletion of email messages when using IMAP.


Is there some way to tell Outlook
via a macro to select a certain menu item? (lPurge
Deleted Messages')
 
Adam,

Due to the nature of IMAP, there will never be a way to take a message and
move it or delete it without causing a result of marking the existing
message for deletion.. The main reason (at least as I understand it) is
because IMAP is designed to have the capability of using the same account
from multiple access points without having to maintain multiple mail
stores.. (if you delete something at work, and when you went home to
access e-mail, it needs to "mark for deletion" so that both computers stay
up-to-date)

A possible answer to your problem is to change a few settings.. I'm not sure
on the specific settings or their location off the top of my head, but you
can hide messages "marked for deletion" and also have messages marked for
deletion auto purged as you move from folder to folder.. (I'm not 100%
certain if the second feature exists as described in Outlook, but it does in
Outlook Express)

This in effect will make it so when you delete something it immediately
disappears, and additionally as you move around your folders. I personally
have not found a Microsoft client that will operate seamlessly with IMAP
without the use of a third party plug-in.. In your case, your problem is
considered a "feature" and is by design...

I suspect you may be able to create a VBA script which will achieve what you
want..

-Jeremy

The only thing keeping a number of people in my company from using
IMAP instead of POP for their email access on Outlook is the way
Outlook handles deletion of email messages when using IMAP. (Keep
the message in place, put a line through it). MAPI isn't a possibility for
these people, for various reasons.

I set out to write a macro that would, when executed, take the currently
selected message or messages and move them to another folder in the
IMAP account, a folder called 'Trash'. This wasn't difficult, and works
fine for MAPI and POP accounts. However, when you do this on the
IMAP account, it makes a copy of the message in the target folder, but
then LEAVES the original in the original folder, WITH A LINE THROUGH
IT. Which is exactly what I'm trying to avoid.

This is using the 'Move' method, not some kind of odd create-delete
duo. And it's very clearly a bug, since you're certainly supposed to be
able to move messages around in the IMAP protocol. It is *almost*
stupid enough to feel intentional: they like the fact that nobody can
stand to use IMAP with Outlook, and so simple workarounds just
happen to fail.

Regardless, I'm still looking for a way to make this work. If I try to
'Delete' a message with a line through it, nothing happens. If I try the
'Move', nothing happens. There does not appear to be any 'Purge'
method in the parent folder object, so you can't just purge deleted
messages every time this happens. There isn't a purge or 'really delete'
or expunge or whatever method in the message's object.

Can anybody think of a workaround? Is there some way to tell Outlook
via a macro to select a certain menu item? (lPurge Deleted Messages')
Is there some way I'm not seeing to move an IMAP item without leaving
the residual message? Is there at least someplace I can REPORT this as
a bug?

Basically, MAPI doesn't work correctly in anything but the most
absolutely perfect conditions. POP doesn't leave a copy on the server,
thus ensuring that at least one person a month loses all of his or her
email to a system crash. IMAP is too irritating to be used, what with
our email at some addresses (after filtering) being more than 50%
SPAM. 'Alternative' (fake) outlook servers like Binari are hideous
monstrosities that cause an order of magnitude more problems than
they solve. And nobody is willing to use an email client other than
Outlook.

Makes me wonder why I didn't just STAY unemployed.

--Adam Lang
 
That feature does not exist in Outlook. That's the problem Adam was trying to find a workaround for.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top