Extracting Custom Properties

G

Guest

I'm using following code to extract certain user properties from post items
located in a public folder. Looks like when user properties are requested
items stay open. When I check the Task Manager, I can see that memory usage
is increasing. After about 100 items my screen starts flashing and I have to
kill Outlook to get out. How can I fix this memory leak?

(This code is located in a message custom form)

Private Sub Export()
Dim itm As Object
For Each itm In ActiveExplorer.CurrentFolder.Items
If itm.MessageClass = "IPM.Post.Change Directive" Then
With itm
strTemp = .UserProperties("MyProperty1").Value & Chr(9) & _
.UserProperties("MyProperty1").Value
WriteOut strTemp
.close olDiscard
End With
Close 1#
End If
Next
End Sub

Private Sub WriteOut(ByVal strTemp As String)
Open "C:\Temp\Export.txt" For Append As 1#
Print #1, strTemp
Close 1#
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top