|
|
|
date: Mon, 14 Jan 2008 13:52:15 -0800 (PST),
group: microsoft.public.exchange.development
back
Re: Type mismatch when iterating Tasks in public folder
Thanks again Dmitry.
Unfortunately, I'm still getting the error after ~250 items with the
changes below.
Thanks,
Morgan
On Jan 14, 8:04 pm, "Dmitry Streblechenko" wrote:
> Explicitly set all items to Nothing and do not us multiple dot notation.
> Keep in mind that
> Set t = fldr.Items(xx)
> translates to
> Set t = fldr.Items.Item(xx)
>
> Dim t As TaskItem
> set Items = fldr.Items
> For xx = 1 To fldr.Items.Count
> Set t = Items.Item(xx)
> Set t = Nohing
> Next
>
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "MPF" wrote in message
>
> news:858fd4a9-894a-4d0b-9c8a-9f046ec3ab20@f10g2000hsf.googlegroups.com...
>
> > Thanks, I think you're correct. Is there a way around this? Maybe by
> > synching the items and going into offline mode?
>
> > Thanks Dmitry.
>
> > On Jan 14, 3:44 pm, "Dmitry Streblechenko" wrote:
> >> You are most likely hitting the 255 open objects limit imposed by
> >> Exchange.
> >> Are you using an online (vs cached) mode in teh profile?
>
> >> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
>
> >> "MPF" wrote in message
>
> >>news:6119eaa1-ec35-48c0-90f1-0c8735943881@u10g2000prn.googlegroups.com...
>
> >> > Thanks in advance for any assistance.
>
> >> > I am trying to extract all Tasks from a public folder and copy
> >> > attributes to an Access table. I get through ~250 objects and then i
> >> > receive a "Type Mismatch" error.
>
> >> > Is there a way to find out exactly what type of item is throwing the
> >> > exception? It appears to be saying a Task is not a Task? I sorted all
> >> > the items in the folder and they -appear- to be tasks.
>
> >> > Any thoughts? Pseudo code below.
>
> >> > For xx = 1 To fldr.Items.Count
>
> >> > Dim t As TaskItem
> >> > Set t = fldr.Items(xx)
>
> >> > Next
>
> >> > Thanks,
>
> >> > Morgan
date: Tue, 15 Jan 2008 07:20:00 -0800 (PST)
author: MPF
Re: Type mismatch when iterating Tasks in public folder
What is your code?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"MPF" wrote in message
news:04442926-abe6-4d2d-8d6a-2ccbfab07dda@i3g2000hsf.googlegroups.com...
> Thanks again Dmitry.
>
> Unfortunately, I'm still getting the error after ~250 items with the
> changes below.
>
>
> Thanks,
>
> Morgan
> On Jan 14, 8:04 pm, "Dmitry Streblechenko" wrote:
>> Explicitly set all items to Nothing and do not us multiple dot notation.
>> Keep in mind that
>> Set t = fldr.Items(xx)
>> translates to
>> Set t = fldr.Items.Item(xx)
>>
>> Dim t As TaskItem
>> set Items = fldr.Items
>> For xx = 1 To fldr.Items.Count
>> Set t = Items.Item(xx)
>> Set t = Nohing
>> Next
>>
>> Dmitry Streblechenko (MVP)http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "MPF" wrote in message
>>
>> news:858fd4a9-894a-4d0b-9c8a-9f046ec3ab20@f10g2000hsf.googlegroups.com...
>>
>> > Thanks, I think you're correct. Is there a way around this? Maybe by
>> > synching the items and going into offline mode?
>>
>> > Thanks Dmitry.
>>
>> > On Jan 14, 3:44 pm, "Dmitry Streblechenko" wrote:
>> >> You are most likely hitting the 255 open objects limit imposed by
>> >> Exchange.
>> >> Are you using an online (vs cached) mode in teh profile?
>>
>> >> Dmitry Streblechenko (MVP)http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>>
>> >> "MPF" wrote in message
>>
>> >>news:6119eaa1-ec35-48c0-90f1-0c8735943881@u10g2000prn.googlegroups.com...
>>
>> >> > Thanks in advance for any assistance.
>>
>> >> > I am trying to extract all Tasks from a public folder and copy
>> >> > attributes to an Access table. I get through ~250 objects and then i
>> >> > receive a "Type Mismatch" error.
>>
>> >> > Is there a way to find out exactly what type of item is throwing the
>> >> > exception? It appears to be saying a Task is not a Task? I sorted
>> >> > all
>> >> > the items in the folder and they -appear- to be tasks.
>>
>> >> > Any thoughts? Pseudo code below.
>>
>> >> > For xx = 1 To fldr.Items.Count
>>
>> >> > Dim t As TaskItem
>> >> > Set t = fldr.Items(xx)
>>
>> >> > Next
>>
>> >> > Thanks,
>>
>> >> > Morgan
>
date: Tue, 15 Jan 2008 11:34:27 -0700
author: Dmitry Streblechenko
Re: Type mismatch when iterating Tasks in public folder
Code below. Thanks Dmitry.
Dim FolderPath As String
FolderPath = "Public Folders\All Public Folders\IT Department
\Tickets"
'FolderPath = "Tasks"
Dim aFolders 'As MAPIFolder
Dim fldr As MAPIFolder
Dim i
Dim objNS As NameSpace
'On Error Resume Next
strFolderPath = Replace(FolderPath, "/", "\")
aFolders = Split(FolderPath, "\")
'get the Outlook objects
' use intrinsic Application object in form script
Set objNS = Application.GetNamespace("MAPI")
'set the root folder
'for public folder access
Set fldr = objNS.Folders(aFolders(0))
'loop through the array to get the subfolder
'loop is skipped when there is only one element in the array
For i = 1 To UBound(aFolders)
Set fldr = fldr.Folders(aFolders(i))
'check for errors
If Err <> 0 Then Exit Sub
Next
Dim myItems As Items
Set myItems = fldr.Items
Dim t As TaskItem
For xx = 1 To fldr.Items.Count
Set t = myItems.Item(xx)
Debug.Print t.subject
Set t = Nothing
Next
On Jan 15, 11:34 am, "Dmitry Streblechenko"
wrote:
> What is your code?
>
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "MPF" wrote in message
>
> news:04442926-abe6-4d2d-8d6a-2ccbfab07dda@i3g2000hsf.googlegroups.com...
>
> > Thanks again Dmitry.
>
> > Unfortunately, I'm still getting the error after ~250 items with the
> > changes below.
>
> > Thanks,
>
> > Morgan
> > On Jan 14, 8:04 pm, "Dmitry Streblechenko" wrote:
> >> Explicitly set all items to Nothing and do not us multiple dot notation.
> >> Keep in mind that
> >> Set t = fldr.Items(xx)
> >> translates to
> >> Set t = fldr.Items.Item(xx)
>
> >> Dim t As TaskItem
> >> set Items = fldr.Items
> >> For xx = 1 To fldr.Items.Count
> >> Set t = Items.Item(xx)
> >> Set t = Nohing
> >> Next
>
> >> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
>
> >> "MPF" wrote in message
>
> >>news:858fd4a9-894a-4d0b-9c8a-9f046ec3ab20@f10g2000hsf.googlegroups.com...
>
> >> > Thanks, I think you're correct. Is there a way around this? Maybe by
> >> > synching the items and going into offline mode?
>
> >> > Thanks Dmitry.
>
> >> > On Jan 14, 3:44 pm, "Dmitry Streblechenko" wrote:
> >> >> You are most likely hitting the 255 open objects limit imposed by
> >> >> Exchange.
> >> >> Are you using an online (vs cached) mode in teh profile?
>
> >> >> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
>
> >> >> "MPF" wrote in message
>
> >> >>news:6119eaa1-ec35-48c0-90f1-0c8735943881@u10g2000prn.googlegroups.com...
>
> >> >> > Thanks in advance for any assistance.
>
> >> >> > I am trying to extract all Tasks from a public folder and copy
> >> >> > attributes to an Access table. I get through ~250 objects and then i
> >> >> > receive a "Type Mismatch" error.
>
> >> >> > Is there a way to find out exactly what type of item is throwing the
> >> >> > exception? It appears to be saying a Task is not a Task? I sorted
> >> >> > all
> >> >> > the items in the folder and they -appear- to be tasks.
>
> >> >> > Any thoughts? Pseudo code below.
>
> >> >> > For xx = 1 To fldr.Items.Count
>
> >> >> > Dim t As TaskItem
> >> >> > Set t = fldr.Items(xx)
>
> >> >> > Next
>
> >> >> > Thanks,
>
> >> >> > Morgan
date: Tue, 15 Jan 2008 12:09:56 -0800 (PST)
author: MPF
|
|