Microsoft KB Archive/275163

= OL98: Restrict Method Does Not Work with GetSharedDefaultFolder =

Article ID: 275163

Article Last Modified on 9/2/2005

-

APPLIES TO


 * Microsoft Outlook 98 Standard Edition

-



This article was previously published under Q275163



SYMPTOMS
In the Outlook 98 object model, if you use the Restrict method to retrieve a subset of items from a delegated folder, all of the items in the folder may be returned.



CAUSE
This issue can occur because the Restrict method only works with a delegated folder if you retrieve appointments from a shared calendar and use the IncludeRecurrences and Sort methods to make sure that all of the appointments are retrieved.

If you use the Restrict method on other folder types, such as a delegated contacts folder, the Restrict method does not function correctly.



RESOLUTION
A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:

  File Name ---  Outllib.dll The fix is also available for the following languages: Italian



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem does not occur in Microsoft Outlook 2000.



MORE INFORMATION
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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

The Restrict method is used to return a subset of a collection of items based on certain criteria.

The GetSharedDefaultFolder method is used to gain access to someone else's folder after they have given you delegate access to their folder.

The Restrict method does function correctly when you use it on your own folder or a Microsoft Exchange Server or Exchange 2000 Server public folder.

The following Microsoft Visual Basic or Microsoft Visual Basic for Applications automation code illustrates how the Restrict method can work with a delegated Calendar folder: Sub Bug Set ol = New Outlook.Application Set olns = ol.GetNamespace(&quot;MAPI&quot;) Set MyRecip = olns.CreateRecipient(&quot;John Smith&quot;) MyRecip.Resolve Set MyFolder = olns.GetSharedDefaultFolder(MyRecip, olFolderCalendar) Set MyItems = MyFolder.Items MyItems.Sort &quot;[Start]&quot; MyItems.IncludeRecurrences = True MyClause = &quot;[Subject] = &quot; & Chr(34) & &quot;Christmas Day&quot; & Chr(34) Set MyResItems = MyItems.Restrict(MyClause) MsgBox MyResItems.Count For Each MyItem In MyResItems MsgBox MyItem.Subject Next End Sub

Keywords: kbbug kbfix kbqfe KB275163

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.