![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |