Memory does not decrease
- From: "Josef" <Josef@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Feb 2006 02:54:57 -0800
The memory used by my trial code - subroutine doDBa (please see below -
OL2003 VBA; this reading data lives on my PC) does not decrease as expected
after it runs an incremental using by my sub rep (Task Manager: if e = 1 Mem
Usage is 327684, if e = 2 Mem Usage is 430760 etc.) If e = 100 I get the
error message: Out of Memory.
Please, how do I have to change my code (preferred OL2003 VBA) so that will
finish correctly without error message Out of memory.
Public Sub rep()
e = 2
For j = 1 To e
doDBa
Next
End Sub
Public Sub doDBa()
Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olInbox As Outlook.MAPIFolder
Dim colItems As Outlook.Items
Dim olItem As Outlook.MailItem
Set olApp = Application
Set olNS = olApp.GetNamespace("MAPI")
Set colFolders = olNS.Folders
Set olMB = colFolders.Item("Osobní složky")
Set colFoldersMB = olMB.Folders
Set olFolderMB = colFoldersMB.Item("Buffer")
Set colItems = olFolderMB.Items
Set olItem = colItems.GetFirst
i = 0
Do While Not olItem Is Nothing
i = i + 1
If i = 100 Then
Exit Do
End If
Debug.Print i & " " & olItem.SenderName & " " & olItem.ReceivedTime
olItem.Delete
Set olItem = colItems.GetNext
Loop
Set olApp = Nothing
Set olNS = Nothing
Set colFolders = Nothing
Set colFoldersMB = Nothing
Set olFolderMB = Nothing
Set colItems = Nothing
Set olItem = Nothing
MsgBox i
End Sub
.
- Follow-Ups:
- Re: Memory does not decrease
- From: Michael Bauer
- Re: Memory does not decrease
- Prev by Date: Re: Folderpicker
- Next by Date: Running Rules on a Mailbox other than the one logged in
- Previous by thread: Re: Folderpicker
- Next by thread: Re: Memory does not decrease
- Index(es):
Relevant Pages
|