locked
vb.net Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem RRS feed

  • Question

  • Hello All,

    Who can help me with a problem that i have right now.
    I am trying to create a prog that will archive mails. I am using VS 2008 and MS outlook 2003.
    The prog is crashing at this point:

     

    Dim I As Integer
    For i = 1 To oItems.Count
    omsg = oItems.Item(I)    **** I will receive the error in the subject at this point.
    If omsg.FlagStatus = OlFlagStatus.olFlagComplete Then
    DT.Rows.Add(omsg.Subject)
    End If
    Next

    I hope that I have posted my question in the correct forum.

    Regards,
    DO.

    Friday, February 5, 2010 10:38 AM

Answers

All replies