Microsoft KB Archive/244082

From BetaArchive Wiki
Knowledge Base


DoVerb on shortcut menu does not function for custom MAPI forms

Article ID: 244082

Article Last Modified on 11/23/2006



APPLIES TO

  • Microsoft Outlook 2000 Standard Edition



This article was previously published under Q244082

SYMPTOMS

If you have a custom MAPI form that implements custom verbs or actions through DoVerb, and an item with an attachment uses this form, invoking the custom verbs from the shortcut menu does not work properly. DoVerb is not called and random verbs (such as Print) may run. This problem does not occur in earlier versions of Outlook.

RESOLUTION

To resolve this problem, obtain Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a).

To obtain SR-1/SR-1a, click the article number below to view the article in the Microsoft Knowledge Base:

245025 OFF2000: How to Obtain and Install Microsoft Office 2000 Service Release 1/1a (SR-1/SR-1a)


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 Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

The following code demonstrates how to set the named property (0x8510) on an item. This code can be used at item creation to set the property on items using the custom form. Additionally, this code could be used in a utility to add the property to existing items on the affected message class.

    //This code assumes that pmsg is a pointer to the message
    SPropValue rgvalToWrite;//this is property to write
    MAPINAMEID sPropName[1];
    LPMAPINAMEID psPropNames[1];
    SPropTagArray * pPropTags = NULL;
    
    //Build the GUID for GetIDsFromNames.
    GUID   testguid;
    testguid.Data1 = 0x62008;
    testguid.Data2 = 0x0;
    testguid.Data3 = 0x0;
    memset (testguid.Data4,0,8);
    testguid.Data4[0] = 0xC0;
    testguid.Data4[7] = 0x46;

    //Set up the request to GetIDsFromNames.
    sPropName[0].lpguid  = & testguid;
    sPropName[0].ulKind = MNID_ID;
    sPropName[0].Kind.lID = 0x8510;
    psPropNames[0] = &sPropName[0];

    //Find the property tag we want to write to.
    hr = pmsg->GetIDsFromNames(1, psPropNames, MAPI_CREATE, &pPropTags);
    
    rgvalToWrite.ulPropTag = PROP_TAG(PT_LONG, PROP_ID(pPropTags->aulPropTag[0]));
    
    ULONG cVal;
    LPSPropValue propval;

    //Get the current value of the property.
    hr = pmsg->GetProps(pPropTags,0, &cVal, &propval);
    
    //Set the 256 bit.
    if  (S_OK == hr)
        rgvalToWrite.Value.l = propval->Value.x | 256;
    else
        rgvalToWrite.Value.l = 256;
    
    //***********************************************************************************

    // Everything to set is now in rgvalToWrite.
    // Write the property back to the item.
    hr = pmsg->SetProps(1, &rgvalToWrite, NULL);
                

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Office 2000 SR-1/SR-1a.


Additional query words: OL2K

Keywords: kbbug kbnofix KB244082