outlook automation

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hello,

I am writing an application in vb.net that iterates
through the sent items folder of a mailbox. Everything
works fine until the application tries to access the "TO"
field of the message, there are no errors, however on the
box that application is running, cpu usage goes to 0% for
both the outlook session and the aspnet_wp.exe session.

This application creates a datatable and a populates a
datagrid as well as writing the dataset to an xml file.
When the "TO" properties are remarked out it works fine.


Any suggestions?

Thanks,

Frank

code follows:

For i = 1 To ticketclosed.Count
msg = SF.Items.Item(i)
If msg.SentOn.Date _
< Date.Today.AddDays(-7) _
Then GoTo SkipOverIfs
If msg.SentOn.Date > _
Date.Today.AddDays(-7) _
Then
newmail = Smail.NewRow
newmail.Item("Index") = i
'newmail.Item("To") = _
'msg.To.ToString
newmail.Item("Date Sent") _
= msg.SentOn.ToShortDateString
newmail.Item("Subject") = msg.Subject
newmail.Item("Body") = msg.Body
Smail.Rows.Add(newmail)
End If
Next i
SkipOverIfs: ol.Quit()
 
I have a guess about what is happening.

There's an anti-virus check that brings up a popup when a program tries to
access the address book, and IIRC, accessing the "To" field triggers that
test. If you're running as an ASP process, I think that causes a block.

I'd suggest going to http://www.asp.net and asking on the forums there.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top