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

Redemption - problem with Save



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 25th 06, 10:30 AM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 87
Default Redemption - problem with Save

I'm using Redemption to circumnavigate Outlook 2003 security on my setup
while using some code to handle new messages. When I set the SafeItem.Item =
CurrentItem, I have to precursor this with a CurrentItem.Save so that I can
access some of the item's properties through the SafeItem object. This works
fine, the only problem is if I ever decide to abort my message (i.e. close
and say No to saving) this obviously still leaves a stray copy of the message
in my Drafts from the earlier CurrentItem.Save. Does anyone know of a way to
stop or fix this?
  #2  
Old January 25th 06, 12:10 PM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 87
Default Redemption - problem with Save

It's a bit clumsy but I've added the following to my Application_Startup
event as a solution. Any suggestions/improvements gratefully received - or
preferably a way of doing this when the message is first created:

Set myNS = Application.GetNamespace("MAPI")
Set myItems = myNS.GetDefaultFolder(olFolderDrafts).Items
myCount = myItems.Count
For n = myCount To 1 Step -1
Set myMail = myItems.Item(n)
Set SafeItem.Item = myMail
myStr = SafeItem.Body & SafeItem.SentOnBehalfOfName & SafeItem.Subject
If SafeItem.Recipients.Count = 0 And SafeItem.Attachments.Count = 0
And myStr = "" Then myMail.Delete
End If
Next


"Martin" wrote:

I'm using Redemption to circumnavigate Outlook 2003 security on my setup
while using some code to handle new messages. When I set the SafeItem.Item =
CurrentItem, I have to precursor this with a CurrentItem.Save so that I can
access some of the item's properties through the SafeItem object. This works
fine, the only problem is if I ever decide to abort my message (i.e. close
and say No to saving) this obviously still leaves a stray copy of the message
in my Drafts from the earlier CurrentItem.Save. Does anyone know of a way to
stop or fix this?

  #3  
Old January 25th 06, 02:38 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Redemption - problem with Save

After you issue the Save command grab the EntryID of the item. If you want
to delete it get it as a Redemption item of some kind and delete it. Use
Redemption to do that so the item doesn't end up in the Deleted Items
folder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Martin" wrote in message
...
I'm using Redemption to circumnavigate Outlook 2003 security on my setup
while using some code to handle new messages. When I set the
SafeItem.Item =
CurrentItem, I have to precursor this with a CurrentItem.Save so that I
can
access some of the item's properties through the SafeItem object. This
works
fine, the only problem is if I ever decide to abort my message (i.e. close
and say No to saving) this obviously still leaves a stray copy of the
message
in my Drafts from the earlier CurrentItem.Save. Does anyone know of a way
to
stop or fix this?


  #4  
Old January 27th 06, 12:31 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption - problem with Save

One workaround could be to use a global (boolean) flag - implement the
Item_Write event hander. Set a global flag, call Save, Outlook will call
your implementation of the Item_Write event hander. If the flag is set, your
code is calling Save, otherwise it is the user explciitly saving the
message.
If the user never saved the message, it should be safe for you to delete it.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Martin" wrote in message
...
I'm using Redemption to circumnavigate Outlook 2003 security on my setup
while using some code to handle new messages. When I set the
SafeItem.Item =
CurrentItem, I have to precursor this with a CurrentItem.Save so that I
can
access some of the item's properties through the SafeItem object. This
works
fine, the only problem is if I ever decide to abort my message (i.e. close
and say No to saving) this obviously still leaves a stray copy of the
message
in my Drafts from the earlier CurrentItem.Save. Does anyone know of a way
to
stop or fix this?



  #5  
Old January 31st 06, 09:56 AM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 87
Default Redemption - problem with Save

Thanks Dmitry - both for your response and for Redemption itself (which has
been a lifesaver!). I've gone with a combination of flags, the Write event,
and the Close event to ensure dummy messages are deleted. Not a complete
solution as Ken points out: they're still ending up in the Deleted Items
folder so I'll have to look more closely into the possibility of using
Redemption to fully delete.

"Dmitry Streblechenko" wrote:

One workaround could be to use a global (boolean) flag - implement the
Item_Write event hander. Set a global flag, call Save, Outlook will call
your implementation of the Item_Write event hander. If the flag is set, your
code is calling Save, otherwise it is the user explciitly saving the
message.
If the user never saved the message, it should be safe for you to delete it.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Martin" wrote in message
...
I'm using Redemption to circumnavigate Outlook 2003 security on my setup
while using some code to handle new messages. When I set the
SafeItem.Item =
CurrentItem, I have to precursor this with a CurrentItem.Save so that I
can
access some of the item's properties through the SafeItem object. This
works
fine, the only problem is if I ever decide to abort my message (i.e. close
and say No to saving) this obviously still leaves a stray copy of the
message
in my Drafts from the earlier CurrentItem.Save. Does anyone know of a way
to
stop or fix this?




 




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
Redemption Christoph Add-ins for Outlook 5 March 6th 06 03:26 PM
Redemption Doesn't ByPass Outllok 2003 Security zbud Add-ins for Outlook 15 February 1st 06 05:59 PM
Undefined Object: testing for Nothing (Redemption) Martin Outlook and VBA 3 January 25th 06 09:21 AM
Problem with Sent Items/Redemption קובץ Outlook and VBA 10 January 12th 06 03:26 PM
Redemption MAPITable Dmitry Streblechenko Add-ins for Outlook 1 January 12th 06 04:09 AM


All times are GMT +1. The time now is 12:32 AM.


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