Hi all,
I am new to .net and I have upgraded a VB6 project to .net using the upgrade wizard.
I have resolved most of the errors however I have an error with a MAPI Folder.
My code is
Private m_objCurrentFolder As Outlook.MAPIFolder
For Each objItem In m_objCurrentFolder.Items
Select Case objItem.Class
Case Outlook.OlObjectClass.olMail
If Subject <> "" Then
If objItem.Subject = Subject Then
ReDim Preserve arrItems(4, i)
arrItems(0, i).Add(objItem.EntryID)
arrItems(1, i).Add(objItem.SentOn)
arrItems(2, i).Add(objItem.ReceivedTime)
arrItems(3, i).Add(objItem.Subject)
If objItem.Body <> "" Then
arrItems(4, i).Add(objItem.Body)
Else
arrItems(4, i).Add(objItem.HTMLBody)
End If
i = i + 1
End If
Else
ReDim Preserve arrItems(4, i)
arrItems(0, i).Add(objItem.EntryID)
arrItems(1, i).Add(objItem.SentOn)
arrItems(2, i).Add(objItem.ReceivedTime)
arrItems(3, i).Add(objItem.Subject)
If objItem.Body <> "" Then
arrItems(4, i).Add(objItem.Body)
Else
arrItems(4, i).Add(objItem.HTMLBody)
End If
i = i + 1
End If
End Select
Next objItem
The error is with the first line
For Each objItem In m_objCurrentFolder.Items
And the error is
C:\Documents and Settings\Administrator\Desktop\byrons\MyDocs\Custo mers\C\CBT\CBTAutoMail\CBTAutoMail.NET\bsolOutlook 2000.
vb(539): Expression is of type 'Outlook.Items', which is not a collection type.
Can anyone please help.
Thanks in advance
Byron