FIX: No Update When Delete All MESSAGE_SHOWADBOOK Recipients (113896)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 3.0

This article was previously published under Q113896

SYMPTOMS

When using the MAPI message action MESSAGE_SHOWADBOOK (11) while composing a message, you can select entries from the address book and those entries are reflected in the recipients list. But if you then go into the address book and delete all the entries, then when the dialog box terminates, it will not update the recipients list. It leaves all prior entries unmodified.

As a result, there's no way to detect if the user has used the dialog box to delete all the entries on the "To:" line.

WORKAROUND

If you use MESSAGE_SENDDLG to bring up the MAPI compose dialog box, you can click the address button to display the address book. If you delete all the entries from the dialog here, the changes are reflected in the Send dialog box. The problem only occurs when you bring up the Address book dialog box directly.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start a new project in Visual Basic. Form1 is created by default.
  2. Add two text boxes (Text1, Text2), a command button (Command1), a MAPISession control (MAPISession1), and a MAPIMessages control (MAPIMessages1) to Form1.
  3. Add the following constants to the general declarations section:
       Const MESSAGE_SHOWADBOOK = 11
       Const SESSION_SIGNON = 1
    						
  4. Add the following code to your form in the appropriate event procedures:
      Sub Form_Load ()
          MAPISession1.Action = SESSION_SIGNON
          MAPIMessages1.SessionID = MAPISession1.SessionID
       End Sub
    
       Sub Command1_Click ()
          MAPIMessages1.MsgIndex = -1
          MAPIMessages1.AddressEditFieldCount = 1
          MAPIMessages1.Action = MESSAGE_SHOWADBOOK
          Text1.Text = Str(MAPIMessages1.RecipCount)
          Text2.Text = ""
          For i = 0 To MAPIMessages1.RecipCount - 1
             MAPIMessages1.RecipIndex = i
             Text2.Text = Text2.Text & MAPIMessages1.RecipDisplayName & ";"
          Next i
          MAPIMessages1.RecipIndex = 0
       End Sub
    						
  5. Press the F5 key to run the program.
  6. Click the command button and select some entries in the address book. You will see them in the text box.
  7. Now click the button again. Delete all the entries in the dialog box. When you click OK and return, you'll see that it is as if nothing happened in the dialog box. This diminishes the usability of the Address dialog box.

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:kbbug KB113896