Is there any way to halt sending while processing messages 
Author Message
 Is there any way to halt sending while processing messages

I'm processing all of the messages in my inbox.
I'm making a count of the messages and
processing the messages with the highest index first.
I'm doing this to avoid prematurely ending my
for......next loop, since I'm moving messages
as I'm processing them. The problem I'm running
into is that I have to send replies and I'm also receiving
messages while I'm processing the current messages.

So the two solutions I've come up with are:
1) Suspend sending and receiving long enough to process the messages.
2) Move all messages to a temporary folder and process them there.

I thought I had come up with the solution with (1) by using the
the logoff and logon methods and then using delivernow from cdo
to send all messages, I'm in corporate mode. Unfortunately when
I send my replies instead of waiting in the outbox they send
automatically even though I'm supposed to be logged off.
I'm also still receiving messages while in the same state.
Is there any way to place messages in the outbox w/o sending?
Is there any way to temporarily suspend email traffic until I'm
ready to send and receive?

If I decide to use solution (2) is there any way to move all
items in a folder at one time instead of going through
a for....next loop?

Here are the offending bits of my code.
---------------------------------------
Public ns As NameSpace
Public ib As MAPIFolder
Public msg As Object
Public InboxCount As Integer
Public replyItem as MailItem

Set ns = ThisOutlookSession.Session
Set ib = ns.GetDefaultFolder(olFolderInbox)
'Log off temporarily for processing
ns.CurrentUser.Session.Logoff
InboxCount = ib.Items.Count

' Run through each item in the Inbox
For msgInboxCounter = 1 To InboxCount
    Set msg = ib.Items.Item(InboxCount - (msgInboxCounter - 1))
    If msg.Class = 43 Then 'mail=43
        '(Misc Code)
                        Set replyItem = Application.CreateItem(olMailItem)
                                With replyItem
                                    .Subject =  "SubjectOfReply"
                                    .Body = "BodyOfReply"
                                    .Recipients.Add "ReplyAddress"
                                    .Send
                                End With
                        Set replyItem = Nothing
    End If
Next
Set ib = Nothing
Set msg = Nothing
'Log back on
ns.CurrentUser.Session.Logon
' Send messages by using delivernow in cdo



Fri, 28 Feb 2003 22:39:38 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. i am getting error sending stdPic to out-of-Process Component

2. Send a Close Message to a Process

3. halt processing

4. Halting and application in process

5. MAPI message Send method puts message in Outbox but it isn't actually sent

6. Processing during loop i.e. Application.Process Messages

7. Sending data both ways with MS Winsock control

8. Looking for a control that allows messages to be sent to SMS messaging service or pager

9. Send message with Outlook closed using Active Messaging

10. Looking for a control that allows messages to be sent to SMS messaging service or pager

11. Dispatched Message And Send Message - Any difference?

12. Send message without creation of sent item...

 

 
Powered by phpBB® Forum Software