Microsoft KB Archive/187933

From BetaArchive Wiki

Article ID: 187933

Article Last Modified on 11/23/2006



APPLIES TO

  • Microsoft Outlook 98 Standard Edition



This article was previously published under Q187933

SYMPTOMS

You programmatically retrieve recurring appointments from someone else's calendar using Microsoft Visual Basic for Applications or Visual Basic Scripting Edition (VBScript), and the start dates for all of the recurring appointments are the same.

CAUSE

The other person did not give you full access to their shared folder.

WORKAROUND

Use one of the following workarounds:

  • Make sure you are given full permissions to the other person's shared folder.
  • Instead of using the Restrict method once to retrieve appointments for a specified date range, use multiple Restrict methods to retrieve the appointments one day at a time. This way each time you use the Restrict method, you inherently know the start date of the appointments.
  • Use the RecurrencePattern of the recurring appointment to manually calculate the start dates of the recurring appointments. This is not a trivial programming task.
  • Microsoft has a fix available for download. To obtain this fix, please go to the following Microsoft Web site:

    For more information about this file, please see the following article in the Microsoft Knowledge Base:

    214575 OL98: Computer Failure May Affect Archive Fidelity

IMPORTANT: If you use the updated files from the patch above, you must use early binding in order for the Restrict method to work correctly. For more information on early vs. late binding, please see the following article in the Microsoft Knowledge Base:

181202 OL98: How to Automate Outlook from Another Program


In addition, to return the correct start times, you must use the Restrict method with one or more of the following properties of an AppointmentItem object:

  • MessageClass
  • Subject
  • Start
  • Duration
  • End
  • Location
  • Sensitivity

These properties are internally cached by Outlook and behave differently than other appointment properties. If you use any other appointment property, such as Categories, the start times of the recurring appointments will be incorrect and will be the start time of the master appointment.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Outlook 98.

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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

For more information about sharing or delegating folders, please see the following article in the Microsoft Knowledge Base:

182642 OL98: (CW) How to Open Someone Else's Calendar or Other Folder


Steps to Reproduce the Problem

IMPORTANT: This code will reproduce the symptoms in the SYMPTOMS section of this article. The code does NOT create a solution.

  1. Create a new recurring appointment in someone else's calendar. Do not use a second account on the Exchange server that you may have. The other calendar must be on a computer with completely different Microsoft Exchange or Microsoft Windows NT logons.
  2. Set the Subject of the appointment to "test recur" (without quotation marks).
  3. Right-click the Calendar folder and then click Properties. Click the Permissions tab, and give yourself Reviewer permissions.
  4. On your computer, run the following Visual Basic or Visual Basic for Applications automation code after setting a reference to the Outlook 98 Type Library:

          Sub TestRecur()
             Set ol = New Outlook.Application
             Set olns = ol.GetNamespace("MAPI")
             ' Change "emailname" to the other person's e-mail name.
             Set Recip = olns.CreateRecipient("emailname")
             Set Fldr = olns.GetSharedDefaultFolder(Recip, olFolderCalendar)
             Set CalItems = Fldr.Items
             CalItems.Sort "[Start]"
             CalItems.IncludeRecurrences = True
             Set ResItems = CalItems.Restrict("[Subject] = 'test recur'")
             For Each Appt In ResItems
                Debug.Print Appt.Start
             Next
          End Sub
                            
  5. Display the Immediate Window in the Visual Basic editor.

For more information about another problem related to working with shared folders and the Outlook 98 object model, please see the following article in the Microsoft Knowledge Base:

183897 OL98: Restrict Method Doesn't Work with GetSharedDefaultFolder


REFERENCES

For more information about creating solutions with Microsoft Outlook 98, please see the following articles in the Microsoft Knowledge Base:

180826 OL98: Resources for Custom Forms and Programming

182349 OL98: Questions About Custom Forms and Outlook Solutions



Additional query words: OutSol OutSol98

Keywords: kbdownload kbpending kbprb KB187933