OL2000: DistListItem Doesn't Prompt to Save When Closed
ID: Q224872
|
The information in this article applies to:
SYMPTOMS
You used the AddMembers method on a distribution list item, but Outlook does not prompt you to save changes when you programmatically close the distribution list.
CAUSE
All of the following conditions are true:
- You did not display the distribution list item before using the AddMembers method.
-and-
- You did not use the Save method to explicitly save the distribution list.
-and-
- You used the Close method with the olPromptForSave constant.
RESOLUTION
Use one of the following methods to work around this problem:
- Use the DistListItem.Display method before using the AddMembers method
-or-
- Use the Save method to explicitly save the DistListItem.
-or-
- Change another property of the DistListItem, such as the DLName, which will properly dirty the item so that it will save.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed
at the beginning of this article.
MORE INFORMATION
If the DistListItem object is not displayed on the screen, then the item is not dirtied when you use the AddMembers method. Therefore, Outlook does not prompt to save changes when the DistListItem is closed.
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/overview/overview.asp
Steps to Reproduce Problem
- Enter the following subroutine in Microsoft Outlook Visual Basic for Applications:
Sub TestAddMembers()
Dim myDLItem As DistListItem
Dim myTempItem as MailItem
Dim myTempRecipt As Recipients
Set myDLItem = CreateItem(olDistributionListItem)
Set myTempItem = CreateItem(olMailItem)
Set myTempRecipt = myTempItem.Recipients
' Change to a resolvable name
myTempRecipt.Add "username"
myTempRecipt.ResolveAll
myDlItem.AddMembers myTempRecipt
myDLItem.Close olPromptForSave
End Sub
- Run the TestAddMembers procedure.
You will not be prompted to save changes to the distribution list and the distribution list will not be saved in your Contacts folder.
REFERENCES
For additional information about available resources and answers
to commonly asked questions about Microsoft Outlook 2000 solutions,
please see the following article in the Microsoft Knowledge Base:
Q146636 OL2000: Questions About Custom Forms and Outlook Solutions
Additional query words:
OutSol OutSol2000 OL2K
Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug