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

Bypassing Outlook's Outbox (or creating a custom outbox)



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 18th 08, 05:51 PM posted to microsoft.public.outlook.program_vba
Ekin
external usenet poster
 
Posts: 7
Default Bypassing Outlook's Outbox (or creating a custom outbox)

Here's my problem: When the user creates a new email (or forwards, replies,
etc), I want the email to go to my MAPIFolder instead of Outbox. When I try
to do this at Application_ItemSend by Item.Move(), I'm getting the mail
deleted or moved error for obvious reasons.

Note that I don't want Outlook to send the emails, I want to handle that
myself. So SaveSentMessageFolder doesn't help. If only there was a
OutboxFolder member of the MailItem class!

Any ideas how I could achieve this?

Ekin
  #2  
Old January 18th 08, 05:59 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Bypassing Outlook's Outbox (or creating a custom outbox)

Please clarify what you're trying to accomplish. The Outbox is only a temporary holding area for messages that have not been delivered to the downstream server.

Also, why are you creating messages in the first place if you don't want Outlook to send them?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ekin" wrote in message ...
Here's my problem: When the user creates a new email (or forwards, replies,
etc), I want the email to go to my MAPIFolder instead of Outbox. When I try
to do this at Application_ItemSend by Item.Move(), I'm getting the mail
deleted or moved error for obvious reasons.

Note that I don't want Outlook to send the emails, I want to handle that
myself. So SaveSentMessageFolder doesn't help. If only there was a
OutboxFolder member of the MailItem class!

Any ideas how I could achieve this?

Ekin

  #3  
Old January 18th 08, 06:11 PM posted to microsoft.public.outlook.program_vba
Ekin
external usenet poster
 
Posts: 7
Default Bypassing Outlook's Outbox (or creating a custom outbox)

I'm trying to move the mail item to a temporary folder (myOutbox), process it
(which may take up to 10-20 seconds), and pass it back to Outlook's default
Outbox.

See my ItemSend below.

Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel
As Boolean) Handles Me.ItemSend
If (Item.Parent.EntryID = _outlookOutbox.EntryID) OrElse _
(Item.Parent.EntryID = _myOutbox.EntryID) Then
Cancel = False
Else
Item.Move(_myOutbox)
Cancel = True
End If
End Sub

I also tried to do the same with Inspectors but got the same "The item has
been moved or deleted" error.

Ekin

"Sue Mosher [MVP-Outlook]" wrote:

Please clarify what you're trying to accomplish. The Outbox is only a temporary holding area for messages that have not been delivered to the downstream server.

Also, why are you creating messages in the first place if you don't want Outlook to send them?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ekin" wrote in message ...
Here's my problem: When the user creates a new email (or forwards, replies,
etc), I want the email to go to my MAPIFolder instead of Outbox. When I try
to do this at Application_ItemSend by Item.Move(), I'm getting the mail
deleted or moved error for obvious reasons.

Note that I don't want Outlook to send the emails, I want to handle that
myself. So SaveSentMessageFolder doesn't help. If only there was a
OutboxFolder member of the MailItem class!

Any ideas how I could achieve this?

Ekin


  #4  
Old January 18th 08, 06:17 PM posted to microsoft.public.outlook.program_vba
Ekin
external usenet poster
 
Posts: 7
Default Bypassing Outlook's Outbox (or creating a custom outbox)

Oh, the Item is moved correctly and the rest of my code works as it should.
So it's just a matter of avoiding the nasty Outlook error...

Ekin

"Ekin" wrote:

I'm trying to move the mail item to a temporary folder (myOutbox), process it
(which may take up to 10-20 seconds), and pass it back to Outlook's default
Outbox.

See my ItemSend below.

Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel
As Boolean) Handles Me.ItemSend
If (Item.Parent.EntryID = _outlookOutbox.EntryID) OrElse _
(Item.Parent.EntryID = _myOutbox.EntryID) Then
Cancel = False
Else
Item.Move(_myOutbox)
Cancel = True
End If
End Sub

I also tried to do the same with Inspectors but got the same "The item has
been moved or deleted" error.

Ekin

"Sue Mosher [MVP-Outlook]" wrote:

Please clarify what you're trying to accomplish. The Outbox is only a temporary holding area for messages that have not been delivered to the downstream server.

Also, why are you creating messages in the first place if you don't want Outlook to send them?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ekin" wrote in message ...
Here's my problem: When the user creates a new email (or forwards, replies,
etc), I want the email to go to my MAPIFolder instead of Outbox. When I try
to do this at Application_ItemSend by Item.Move(), I'm getting the mail
deleted or moved error for obvious reasons.

Note that I don't want Outlook to send the emails, I want to handle that
myself. So SaveSentMessageFolder doesn't help. If only there was a
OutboxFolder member of the MailItem class!

Any ideas how I could achieve this?

Ekin


  #5  
Old January 18th 08, 07:04 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Bypassing Outlook's Outbox (or creating a custom outbox)

You can always use On Error Resume Next to suppress most error messages.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ekin" wrote in message ...
Oh, the Item is moved correctly and the rest of my code works as it should.
So it's just a matter of avoiding the nasty Outlook error...

Ekin

"Ekin" wrote:

I'm trying to move the mail item to a temporary folder (myOutbox), process it
(which may take up to 10-20 seconds), and pass it back to Outlook's default
Outbox.

See my ItemSend below.

Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel
As Boolean) Handles Me.ItemSend
If (Item.Parent.EntryID = _outlookOutbox.EntryID) OrElse _
(Item.Parent.EntryID = _myOutbox.EntryID) Then
Cancel = False
Else
Item.Move(_myOutbox)
Cancel = True
End If
End Sub

I also tried to do the same with Inspectors but got the same "The item has
been moved or deleted" error.

Ekin

"Sue Mosher [MVP-Outlook]" wrote:

Please clarify what you're trying to accomplish. The Outbox is only a temporary holding area for messages that have not been delivered to the downstream server.

Also, why are you creating messages in the first place if you don't want Outlook to send them?



"Ekin" wrote in message ...
Here's my problem: When the user creates a new email (or forwards, replies,
etc), I want the email to go to my MAPIFolder instead of Outbox. When I try
to do this at Application_ItemSend by Item.Move(), I'm getting the mail
deleted or moved error for obvious reasons.

Note that I don't want Outlook to send the emails, I want to handle that
myself. So SaveSentMessageFolder doesn't help. If only there was a
OutboxFolder member of the MailItem class!

Any ideas how I could achieve this?

Ekin

  #6  
Old January 18th 08, 08:34 PM posted to microsoft.public.outlook.program_vba
Ekin
external usenet poster
 
Posts: 7
Default Bypassing Outlook's Outbox (or creating a custom outbox)

Thank you, Sue, but that didn't work.

When I debug in VS and follow the ThisApplication_ItemSend through line by
line, I can get to End Sub without any errors; when I hit F10 on End Sub, the
annoying "The item has been moved or deleted" message is thrown by Outlook
--VS Interop isn't even aware of it! So as far as VB is concerned, there is
no error.

Problem remains...

Ekin

"Sue Mosher [MVP-Outlook]" wrote:

You can always use On Error Resume Next to suppress most error messages.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ekin" wrote in message ...
Oh, the Item is moved correctly and the rest of my code works as it should.
So it's just a matter of avoiding the nasty Outlook error...

Ekin

"Ekin" wrote:

I'm trying to move the mail item to a temporary folder (myOutbox), process it
(which may take up to 10-20 seconds), and pass it back to Outlook's default
Outbox.

See my ItemSend below.

Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel
As Boolean) Handles Me.ItemSend
If (Item.Parent.EntryID = _outlookOutbox.EntryID) OrElse _
(Item.Parent.EntryID = _myOutbox.EntryID) Then
Cancel = False
Else
Item.Move(_myOutbox)
Cancel = True
End If
End Sub

I also tried to do the same with Inspectors but got the same "The item has
been moved or deleted" error.

Ekin

"Sue Mosher [MVP-Outlook]" wrote:

Please clarify what you're trying to accomplish. The Outbox is only a temporary holding area for messages that have not been delivered to the downstream server.

Also, why are you creating messages in the first place if you don't want Outlook to send them?



"Ekin" wrote in message ...
Here's my problem: When the user creates a new email (or forwards, replies,
etc), I want the email to go to my MAPIFolder instead of Outbox. When I try
to do this at Application_ItemSend by Item.Move(), I'm getting the mail
deleted or moved error for obvious reasons.

Note that I don't want Outlook to send the emails, I want to handle that
myself. So SaveSentMessageFolder doesn't help. If only there was a
OutboxFolder member of the MailItem class!

Any ideas how I could achieve this?

Ekin


 




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
Outbox Dajan Outlook Express 1 February 15th 07 04:22 AM
outbox Bruce Hagen Outlook Express 4 June 28th 06 09:34 AM
OUTBOX WAYNE DEMBOWSKI Outlook - Installation 2 June 18th 06 03:53 AM
Outbox issue Outlook Express 1 June 3rd 06 09:34 AM
How to get my custom e-mail form to get out of my Outbox? Nat Outlook - Using Forms 7 March 17th 06 07:53 PM


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