Details Method

Microsoft Outlook Visual Basic

Details Method

       

The Details method displays a modal dialog box that provides detailed information about an AddressEntry object. You must use error handling to handle run time errors when the user clicks Cancel in the dialog box. The Details method actually stops the code from running while the dialog box is displayed.

Note  The Details method fails if the Name property is empty.

expression.Details(HWnd)

expression   Required AddressEntry object.

HWnd   Optional Variant. The parent window handle for the details dialog box. A zero value (the default) specifies a modal dialog box.

Example

This Visual Basic for Applications example uses the Add method to add a new AddressEntry to the Personal Address Book. The Name, "John Q. Public" is necessary to avoid errors.

If this entry already exists, the code skips to DialogBox:. The Details method displays a dialog box that shows the information for this entry.

Set myOlApp = CreateObject("Outlook.Application")
    Set myNamespace = myOlApp.GetNamespace("MAPI")
    Set myAddrList = myNamespace.AddressLists("Personal Address Book")
    Set myAddrEntries = myAddrList.AddressEntries
    Set myEntry = myAddrEntries.Add("Microsoft Mail Address")
    myEntry.Name = "John Q. Public"
    On Error GoTo DialogBox
    myEntry.Address = "[email protected]"
    myEntry.Update
DialogBox:
    myEntry.Details