OL98: Restrict May Not Work with Uncached PropertiesID: Q222484
|
You use the Restrict and IncludeRecurrences methods in the Outlook object model and Outlook appears to hang or the collection of items does not appear to be functioning correctly.
This may happen if all of the following are true:
Use one of the following workarounds:
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/
Sub RestrictTest()
Dim outapp As Outlook.Application
Dim itms As Outlook.Items
Dim itmsR As Outlook.Items
Dim itm As Outlook.AppointmentItem
Dim strQ As String
Set outapp = New Outlook.Application
Set itms = outapp.ActiveExplorer.CurrentFolder.Items
itms.IncludeRecurrences = True
itms.Sort "[Start]"
strQ = "[Mileage] = 'test'"
Set itmsR = itms.Restrict(strQ)
'itmsR.SetColumns "Mileage"
For Each itm In itmsR '<-- hangs on this line
If itm.Start > #6/1/1999# Then Exit For
Debug.Print itm.Subject & " : " & itm.Start & " : " & itm.Mileage
Next
End Sub
For more information about creating solutions with Microsoft Outlook 98,
please see the following articles in the Microsoft Knowledge Base:
Q180826 OL98: Resources for Custom Forms and Programming
Q182349 OL98: Questions About Custom Forms and Outlook Solutions
Additional query words: OutSol OutSol98 vbscript
Keywords : kbdta OffVBS
Version :
Platform :
Issue type : kbprb
Last Reviewed: May 27, 1999