Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2003, 09:08 AM
Authorized User
 
Join Date: Jun 2003
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default Outlook 2000 errors

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2000 Contacts into Access MWiseman Access VBA 5 January 27th, 2005 02:32 PM
MS Outlook 2000 procedure cunninb VB How-To 0 January 5th, 2005 08:40 PM
Outlook 2000 errors byron Pro VB.NET 2002/2003 3 December 1st, 2003 10:17 AM
Access 2000 and Outlook vaheh Access VBA 1 August 13th, 2003 03:18 PM
Outlook 2000 Automation byron Pro VB 6 4 July 10th, 2003 01:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.