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

Messages stuck in outbox



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 24th 06, 09:51 PM posted to microsoft.public.outlook.program_vba
mecg96
external usenet poster
 
Posts: 4
Default Messages stuck in outbox

Hi!
I'm sending emails and saving the same item to a .pst. I am changing the
sent item destination using:
StoreID = objDestinationFolder.StoreID
FolderID = objDestinationFolder.EntryID
Set olNewMessage.SaveSentMessageFolder = objDestinationFolder

It is working fine, but when all the messages are sent the outbox still
shows all the emails there. It seems like it won't move the sent items to the
..pst until I do a "send and receive" (F9). Is there a way to do this from
code? or how can I avoid saving it to the sent items at all?

Thanks!!
Ads
  #2  
Old July 25th 06, 03:07 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Messages stuck in outbox

You can find the CommandBarControl that represents the Send/Receive menu
item and call its Execute method to perform a Send/Receive action.

Try the DeleteAfterSubmit Boolean, set it true on the mail item and no copy
will be saved after sending.

--
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


"mecg96" wrote in message
...
Hi!
I'm sending emails and saving the same item to a .pst. I am changing the
sent item destination using:
StoreID = objDestinationFolder.StoreID
FolderID = objDestinationFolder.EntryID
Set olNewMessage.SaveSentMessageFolder = objDestinationFolder

It is working fine, but when all the messages are sent the outbox still
shows all the emails there. It seems like it won't move the sent items to
the
.pst until I do a "send and receive" (F9). Is there a way to do this from
code? or how can I avoid saving it to the sent items at all?

Thanks!!


  #3  
Old July 25th 06, 04:01 PM posted to microsoft.public.outlook.program_vba
mecg96
external usenet poster
 
Posts: 4
Default Messages stuck in outbox

Hi Ken,

Thanks for the help. It's working now, but I have another problem. After all
the messages are sent I close the .pst file. The problem is that for the last
messages the send/receive is still active when the close .pst command
executes. I tried with the "Doevents" after the Send/Receive, but it didn't
work. Is there a way of telling the macro to wait until the send/receive
finishes?

Thx!



"Ken Slovak - [MVP - Outlook]" wrote:

You can find the CommandBarControl that represents the Send/Receive menu
item and call its Execute method to perform a Send/Receive action.

Try the DeleteAfterSubmit Boolean, set it true on the mail item and no copy
will be saved after sending.

--
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


"mecg96" wrote in message
...
Hi!
I'm sending emails and saving the same item to a .pst. I am changing the
sent item destination using:
StoreID = objDestinationFolder.StoreID
FolderID = objDestinationFolder.EntryID
Set olNewMessage.SaveSentMessageFolder = objDestinationFolder

It is working fine, but when all the messages are sent the outbox still
shows all the emails there. It seems like it won't move the sent items to
the
.pst until I do a "send and receive" (F9). Is there a way to do this from
code? or how can I avoid saving it to the sent items at all?

Thanks!!



  #4  
Old July 26th 06, 02:14 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Messages stuck in outbox

There's no way to tell if the send/receive is finished usually.

You can use the SyncObjects collection and initiate a synch in your code and
then handle the synch end event. That would work, usually most people have 1
defined send/receive group, but if there are more it can be very hard to
tell which accounts are being sent with which groups.

Look at http://www.outlookcode.com/threads.a...essageid=16184
for some sample code using syncobjects, it might help.

--
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


"mecg96" wrote in message
...
Hi Ken,

Thanks for the help. It's working now, but I have another problem. After
all
the messages are sent I close the .pst file. The problem is that for the
last
messages the send/receive is still active when the close .pst command
executes. I tried with the "Doevents" after the Send/Receive, but it
didn't
work. Is there a way of telling the macro to wait until the send/receive
finishes?

Thx!


 




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
messages stuck in outbox Kelly Outlook Express 2 June 16th 06 12:04 AM
Messages stuck in Outbox Precious_Stone Outlook Express 6 May 23rd 06 10:04 PM
Messages stuck in Outbox Taurean Outlook Express 4 May 15th 06 08:56 PM
Stuck in Outbox ? McHenry Outlook - General Queries 1 April 1st 06 05:48 AM
messages stuck in outbox Bruce Hagen Outlook Express 4 March 14th 06 08:42 PM


All times are GMT +1. The time now is 07:35 PM.


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