Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Item.Copy - Can't Delete?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Item.Copy - Can't Delete?
Bob Smith 27.07.2006 17:55:01
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

Re: Item.Copy - Can't Delete?
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 02.09.2006 15:30:48
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" <BobSmith[ at ]discussions.microsoft.com> wrote in message news:AA186901-8BB4-44C1-9851-B6F71FB8525F[ at ]microsoft.com...
[Quoted Text]
>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
>
Re: Item.Copy - Can't Delete?
Bob Smith 03.09.2006 07:49:01
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:

[Quoted Text]
> 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" <BobSmith[ at ]discussions.microsoft.com> wrote in message news:AA186901-8BB4-44C1-9851-B6F71FB8525F[ at ]microsoft.com...
> >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
> >
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net