OL97: Can't Display or Save Item Using GetItemFromIDID: Q238609
|
You try to programmatically display or save an item, but the Display or Save methods in the Outlook object model do not seem to work.
This behavior occurs when all of the following conditions are true:
Depending on the needs of your solution, you may be able to work around the problem by using an alternate method of referencing the item. For additional information about how to programmatically reference items, please see the following article in the Microsoft Knowledge Base:
Q180696 OL97: Programming Examples for Referencing Items and Folders
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
This problem is not related to the type of folder the items are stored in. The problem occurs regardless of whether the folder is stored in a Personal Folders (.pst) file, Microsoft Exchange public folders, or a Microsoft Exchange mailbox.
Dim x
Sub CommandButton1_Click()
Dim ns, myFolder, myItem, myEntryID, myStoreID
Set ns = Application.GetNamespace("MAPI")
Set myFolder = Application.ActiveExplorer.CurrentFolder
Set myItem = myFolder.Items(1)
MsgBox "First item in folder: " & myItem.Subject
myEntryID = myItem.EntryID
myStoreID = myItem.Parent.StoreID
Set myItem = Nothing
Set myItem = ns.GetItemFromID(myEntryID, myStoreID)
MsgBox "Item found using GetItemFromID: " & myItem.Subject
myItem.Display
Set myItem = Nothing
Set myFolder = Nothing
Set ns = Nothing
End Sub
For more information about creating solutions with Microsoft Outlook 97,
please see the following articles in the Microsoft Knowledge Base:
Q166368 OL97: How to Get Help Programming with Outlook
Q170783 OL97: Q&A: Questions About Customizing or Programming Outlook
Additional query words: OutSol OutSol97
Keywords :
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: August 5, 1999