![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I've written an Outlook 2003 VBA script which creates multiple emails
in the drafts box. I'd like to send them all, but at the 100th "send" command the system chokes, and the emails get moved or deleted, but are not actually sent out. Here's my code: Sub SendMerge() Dim oItem As MailItem Dim olfldrSource As MAPIFolder Dim nSendCount As Integer nSendCount = 1 doneScan = False While (doneScan = False) Set olfldrSource = Outlook.GetNamespace("MAPI").GetDefaultFolder(olFo lderDrafts) If (olfldrSource.Items.count() = 0) Then doneScan = True End If Set oItem = olfldrSource.Items(1) DoEvents Debug.Print nSendCount & " Sending: " & oItem.To & " Email: " & oItem.Subject nSendCount = nSendCount + 1 oItem.Send Set oItem = Nothing Set olfldrSource = Nothing Wend End Sub I know similar problems have been discussed before, but I've not seen a conclusive answer. After reading the boards, I believe the problem is that I've exceeded the number of COM objects allowed by the Exchange Server, but this is just a guess. I've also seen posts about explicit Garbage Collection above and beyond setting all Objects = Nothing, but I've seen no examples on how to do this. Does anyone have any suggestions? What am I doing wrong and how do I fix this? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot connect to Exchange server from Outlook client on Windows 2003 Server | AllenM | Outlook - General Queries | 0 | May 16th 06 07:44 PM |
Multiple email accounts from exchange server in Outlook. | Joao | Outlook - General Queries | 2 | March 10th 06 11:25 PM |
Multiple accounts on one exchange server Outlook 2003 | pk | Outlook - Installation | 2 | January 31st 06 07:13 AM |
Automatically trigger a VBA macro to run when connection to exchange server has been made. | [email protected] | Outlook and VBA | 1 | January 30th 06 11:29 PM |
Automatically trigger a VBA macro to run when connection to exchange server has been made. | [email protected] | Outlook and VBA | 0 | January 25th 06 09:52 PM |