A menu command "Extracting e-mail" via "C API" enquires

Hi,

I’m programming a menu addin(based on UIADDIN) with the ‘C API Tool Kit 6.5’ and ‘Lotus Notes 6.5’. I have installed a menu command “Extract e-mail”.

When a note is selected on the list and the user press “Extract e-mail” (text file). I want to retrieve to handle of the selected note.

Is it possible in a menu addin (via LNCALLBACK) and how can one do it?

NAMRESULT LNCALLBACK AddinMenuProc (WORD wMsg, LONG lParam)

{

static WORD startingID; // the Notes ID for the first addin menu

item

switch (wMsg)

{

 case NAMM_INIT:

 {

   NAM_INIT_INFO *pInitInfo = (NAM_INIT_INFO *)lParam;



   // Add the menu item to the Notes Actions menu

   // Assign this menu item an id and a name

   pInitInfo->wMenuID = IDM_STORE_MESSAGE;

   strcpy(pInitInfo->MenuItemName, STR_STORE_MESSAGE);



   if (pInitInfo->wMenuItemNumber == 0) startingID = pInitInfo-

wStartingID;

   // Tell Notes that there are no more menu items to add

   return (NAM_INIT_STOP);

 }



 case NAMM_INITMENU:

 {

   NAM_INITMENU_INFO *pInitMenuInfo = (NAM_INITMENU_INFO *)lParam;

   WORD Flags;



   if ((pInitMenuInfo->Data.Context == NAM_IN_VIEW) &&

(pInitMenuInfo->Data.fCanExport))

     Flags = MF_ENABLED  | MF_BYCOMMAND;

   else

     Flags = MF_GRAYED | MF_BYCOMMAND;

   EnableMenuItem( pInitMenuInfo->hMenu, startingID +

IDM_STORE_MESSAGE, Flags);

 }



 case NAMM_COMMAND:

 {

   NAM_COMMAND_INFO *pCommandInfo = (NAM_COMMAND_INFO *)lParam;

   VIEWIXDATA ViewData;

   HANDLE   hSelectedList;



   switch (pCommandInfo->wMenuID)

   {

     case IDM_STORE_MESSAGE:

       if ((pCommandInfo->Data.Context == NAM_IN_VIEW) &&

(pCommandInfo->Data.fCanExport))

       {

         // Store message

         ViewData = pCommandInfo->Data.IXData.View;

         hSelectedList = pCommandInfo-

Data.IXData.View.hSelectedList;

         HERE IT DOES NOT WORK, I CAN'T DO ANYTHING WITH

hSelectedList

       }

       break;

   }

 }



 case NAMM_TERM:

   return (NAM_NOERROR);



 default:

   return (NAM_NOERROR);

}

}

Thanks for any assistance or suggestions.

Regards

Ron Roland

PS; IDE is MS Visual C++ 7.1.

Subject: A menu command “Extracting e-mail” via “C API” enquires…

If you look at the Genii Software website, then go to Downloads - Midas Rich Text C++ sample apps on the menu at the top, there is a menu add in sample which shows how to export the documents to HTML. The sample shows this using the Midas Rich Text C++ API, but you can use the code in there to see how to get the selected documents and do the appropriate NSFNoteOpen. You don’t have to use the Midas part of the logic, although you can certainly request a free evaluation license if you want to see how it could help, but the basic structure of the code should help.