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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Item.Copy - Can't Delete?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 27th 06, 07:55 PM posted to microsoft.public.outlook.program_addins
Bob Smith
external usenet poster
 
Posts: 34
Default Item.Copy - Can't Delete?

I need to make a copy of the item someone is sending in Outlook. This appears
to work fine and saves a duplicate in the outbox of the sending item. I then
try to delete the item but it still stays in the outbox, what am I doing
wrong? If I attempt to do a second delete outlook says the item does not
exist.

Would appreciate anyones help on this. I need to ensure the item is not left
in the outbox. Using Outlook 2003

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objNS As NameSpace
Dim objCopy As MailItem

Set objcopy = Item.Copy
' objcopy.Save --- Makes no difference for the delete
objcopy.Delete 'Doesn't appeat to remove from the outbox
'objcopy.Delete 'Returns that the message no longer existt
End Sub

Ads
  #2  
Old September 2nd 06, 05:30 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Item.Copy - Can't Delete?

Why are you copying in ItemSend rather than waiting until the item gets to the Sent Items folder, where it will have all the sender and sent date/time details? And what's the point of making a copy if you're just going to delete it?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Bob Smith" wrote in message ...
I need to make a copy of the item someone is sending in Outlook. This appears
to work fine and saves a duplicate in the outbox of the sending item. I then
try to delete the item but it still stays in the outbox, what am I doing
wrong? If I attempt to do a second delete outlook says the item does not
exist.

Would appreciate anyones help on this. I need to ensure the item is not left
in the outbox. Using Outlook 2003

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objNS As NameSpace
Dim objCopy As MailItem

Set objcopy = Item.Copy
' objcopy.Save --- Makes no difference for the delete
objcopy.Delete 'Doesn't appeat to remove from the outbox
'objcopy.Delete 'Returns that the message no longer existt
End Sub

  #3  
Old September 3rd 06, 09:49 AM posted to microsoft.public.outlook.program_addins
Bob Smith
external usenet poster
 
Posts: 34
Default Item.Copy - Can't Delete?

Very good questions.

I am copying the item so I can then check the size of it. I don't want to
save the origional item because it would then consume space in their inbox.
If I can make a copy, check the size and then delete the copy before sending
the origional it will not affect the mailbox limits iin their mailbox.

e.g. If I save the oritional item, say it's 150mb and they have a 100mb mail
limit on send, the user will not be able to send the message. If I make a
copy, then check the size and delete before sending the origional, this will
not affect the mailbox size.

Does that make sence?



"Sue Mosher [MVP-Outlook]" wrote:

Why are you copying in ItemSend rather than waiting until the item gets to the Sent Items folder, where it will have all the sender and sent date/time details? And what's the point of making a copy if you're just going to delete it?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Bob Smith" wrote in message ...
I need to make a copy of the item someone is sending in Outlook. This appears
to work fine and saves a duplicate in the outbox of the sending item. I then
try to delete the item but it still stays in the outbox, what am I doing
wrong? If I attempt to do a second delete outlook says the item does not
exist.

Would appreciate anyones help on this. I need to ensure the item is not left
in the outbox. Using Outlook 2003

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objNS As NameSpace
Dim objCopy As MailItem

Set objcopy = Item.Copy
' objcopy.Save --- Makes no difference for the delete
objcopy.Delete 'Doesn't appeat to remove from the outbox
'objcopy.Delete 'Returns that the message no longer existt
End Sub


 




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
Is it possible to delete appt. item from folder obtained from GetSharedDefaultFolder? Brian J. Matuschak Outlook - Calandaring 2 May 1st 06 09:16 PM
How do I modify Delete button to also mark item as read? [email protected] Outlook and VBA 1 April 24th 06 07:14 AM
Calendar item will not delete on cancel Charles Outlook - Calandaring 0 February 6th 06 12:43 AM
Cannot open Calendar item to delete... kage13 Outlook - Calandaring 1 February 1st 06 11:17 PM
Handling Task Item Delete Event AtulSureka Outlook - Using Forms 0 January 24th 06 11:25 AM


All times are GMT +1. The time now is 08:22 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.