PRB: PR_EMAIL_ADDRESS Missing When Querying Offline AddressBook

ID: Q197789

The information in this article applies to:

SYMPTOMS

When querying an offline addressbook that does not contain details, there are circumstances when some of the properties that normally return will not appear. For example, when selecting a mailbox using the "To:" button, the PR_EMAIL_ADDRESS is missing.

RESOLUTION

Instead of querying for a specific property, return the entire property array. You can do this by setting the SPropTagArray parameter to NULL when calling the HrQueryAllRows() function.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

Use the following code to see the behavior:

   static SizedSPropTagArray( 1, sptCol) = { 1, PR_EMAIL_ADDRESS };

   // Query the recipient table for the email_address property

   if ( FAILED( hRes = HrQueryAllRows( lpTable,
              (LPSPropTagArray)&sptCol,NULL, NULL, 0, &pRow ) ) )
      goto Quit;

   if ( pRow && PR_EMAIL_ADDRESS == pRow->aRow[0].lpProps[0].ulPropTag )
      MessageBox(NULL,"PR_EMAIL_ADDRESS returned",NULL,MB_OK);
   else
      MessageBox(NULL,"PR_EMAIL_ADDRESS unavailable",NULL,MB_OK);

Additional query words:
Keywords          : kbMAPI kbMsg kbMAPI100 
Version           : WINDOWS:5.0,5.5
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: December 23, 1998