//AB/ Project Read Email dialog //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Read Email dialog" //AB/ Set ProjectFileName to "ReadMail.Dg" // Project Object Structure // oReadMailPanel is a ModalPanel // oTabDialog is a TabDialog // oSubjectTabPage is a TabPage // oSenderName is a cDisplayOnlyForm // oSubjectForm is a cDisplayOnlyForm // oDateReceivedForm is a cDisplayOnlyForm // oMessageText is a Edit // oRecipientsTabPage is a TabPage // oRecipientsGrid is a cReadOnlyGrid // oEntryIds is a cEntryIdsArray // oRecipientsFloater is a FormFloatingPopupMenu // oRecipientsCount is a cDisplayOnlyForm // oAttachmentsTabPage is a TabPage // oAttachedFilesGrid is a cReadOnlyAttachFilesGrid // oAttachmentCount is a cDisplayOnlyForm // oCloseButton is a Button // Register all objects Register_Object oAttachedFilesGrid Register_Object oAttachmentCount Register_Object oAttachmentsTabPage Register_Object oCloseButton Register_Object oDateReceivedForm Register_Object oEntryIds Register_Object oMessageText Register_Object oReadMailPanel Register_Object oRecipientsCount Register_Object oRecipientsFloater Register_Object oRecipientsGrid Register_Object oRecipientsTabPage Register_Object oSenderName Register_Object oSubjectForm Register_Object oSubjectTabPage Register_Object oTabDialog //AB-StoreTopStart Use ParseFn.Pkg Use MapiSession.Pkg Use cEntryIdsArray.Pkg //AB-StoreTopEnd //AB-IgnoreStart Use cDisplayOnlyForm.Pkg Use cReadOnlyGrid.Pkg Use cReadOnlyAttachFilesGrid.Pkg //AB-IgnoreEnd Object oReadMailPanel is a ModalPanel //AB-StoreTopStart Set Extended_Window_Style To WS_EX_TOOLWINDOW False Set Extended_Window_Style To WS_EX_DLGMODALFRAME True On_Key kCancel Send Close_Panel //AB-StoreTopEnd Set Label to "Read Mail" Set Size to 240 300 //AB-DDOStart //AB-DDOEnd Object oTabDialog is a TabDialog Set Size to 202 286 Set Location to 5 5 Set Help_Id to Hlp_ReadMail_Dialog Object oSubjectTabPage is a TabPage Set Label to "Subject" Set Tab_ToolTip_Value to "Subject and body" Object oSenderName is a cDisplayOnlyForm Set Label to "From:" Set Size to 13 225 Set Location to 5 55 End_Object // oSenderName Object oSubjectForm is a cDisplayOnlyForm Set Label to "Subject:" Set Size to 13 225 Set Location to 20 55 End_Object // oSubjectForm Object oDateReceivedForm is a cDisplayOnlyForm Set Label to "Date received:" Set Size to 13 85 Set Location to 34 55 End_Object // oDateReceivedForm Object oMessageText is a Edit Set Label to "Text:" Set Size to 121 273 Set Location to 60 5 Set Label_Col_Offset to 2 //AB-StoreStart Set Read_Only_State To True Set Oem_Translate_State To False //AB-StoreEnd End_Object // oMessageText //AB-StoreStart //**************************************************************************** // Description // To display the subject of the message and its details. // // $Rev History // 12/14/99 VO Module header created //**************************************************************************** Procedure DoDisplaySubjectValues Integer hoMapiSession String sSenderName sMessageSubject sDateReceived sMapiMessageText Integer hoMessageText Get psMessageSenderName Of hoMapiSession To sSenderName Get psMessageSubject Of hoMapiSession To sMessageSubject Get psMessageDateReceived Of hoMapiSession To sDateReceived Get psMessageText Of hoMapiSession To sMapiMessageText Set Value Of oSenderName To sSenderName Set Value Of oSubjectForm To sMessageSubject Set Value Of oDateReceivedForm To sDateReceived Move oMessageText To hoMessageText Send Delete_Data To hoMessageText Send Insert To hoMessageText sMapiMessageText Send Beginning_Of_Data To hoMessageText End_Procedure // DoDisplaySubjectValues //AB-StoreEnd End_Object // oSubjectTabPage Object oRecipientsTabPage is a TabPage Set Label to "Recipients" Set Tab_ToolTip_Value to "Recipients" Object oRecipientsGrid is a cReadOnlyGrid Set Size to 160 273 Set Location to 5 5 Set Line_Width to 2 0 Set Form_Width item 0 to 132 Set Header_Label item 0 to "Name" Set Form_Width item 1 to 132 Set Header_Label item 1 to "Address" //AB-StoreStart //**************************************************************************** // Description // This object stores the entry id of each address // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Object oEntryIds Is A cEntryIdsArray End_Object // oEntryIds //**************************************************************************** // Description // This method will show the detail information for the current receiver. // // $Rev History // 24/04/00 VO Retrieve the length of entryid and pass this to the // addresseedetails function. Better than length (sEntryId). // 06/01/99 VO Module header created //**************************************************************************** Procedure DoShowDetails Integer iCurrentItem iEntryIdItem iRetval hoEntryIds iLength String sEntryId Move oEntryIds To hoEntryIds Get Current_Item To iCurrentItem Move ((iCurrentItem / 2) * 2) To iCurrentItem Get Aux_Value Item iCurrentItem To iEntryIdItem Get ReceiverEntryId Of hoEntryIds Item iEntryIdItem To sEntryId Get Integer_Value Of hoEntryIds Item (iEntryIdItem + 1) To iLength Get AddresseeDetails Of oMapiSession sEntryId iLength To iRetval End_Procedure // DoShowDetails //**************************************************************************** // Description // This object adds the Details function to the standard floater. // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Object oRecipientsFloater Is A FormFloatingPopupMenu Send Insert_Item Msg_None "" 0 Send Insert_Item Msg_DoShowDetails "Details" 0 End_Object // oRecipientsFloater Set Floating_Menu_Object To (oRecipientsFloater (Self)) //**************************************************************************** // Description // When the grid data is erased we will delete the data in the array too. // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Procedure DoEraseData Send Delete_Data To oEntryIds Send Delete_Data End_Procedure // DoEraseData //AB-StoreEnd End_Object // oRecipientsGrid Object oRecipientsCount is a cDisplayOnlyForm Set Label to "Recipients:" Set Size to 13 60 Set Location to 170 219 Set Form_DataType to 0 End_Object // oRecipientsCount //AB-StoreStart Procedure DoDisplayRecipients Integer hoMapiSession Integer iCounter iItem iRecipCount hoRecipientsGrid hoEntryIds iLength String sRecipientName sRecipientAddress sEntryId Get piMessageRecipCount Of hoMapiSession To iRecipCount Set Value Of oRecipientsCount To iRecipCount Move oRecipientsGrid To hoRecipientsGrid Move (oEntryIds (hoRecipientsGrid)) To hoEntryIds Send DoEraseData To hoRecipientsGrid For iCounter From 1 To iRecipCount Get RecipientName Of hoMapiSession iCounter To sRecipientName Get RecipientAddress Of hoMapiSession iCounter To sRecipientAddress Get RecipientEntryId Of hoMapiSession iCounter To sEntryId Get RecipientEntryIdLength Of hoMapiSession iCounter To iLength Get AddRecipientId Of hoEntryIds sEntryId iLength To iItem Send Add_Item To hoRecipientsGrid Msg_None sRecipientName Set Aux_Value Of hoRecipientsGrid Item (Item_Count (hoRecipientsGrid) - 1) To iItem Send Add_Item To hoRecipientsGrid Msg_None sRecipientAddress Loop End_Procedure // DoDisplayRecipients //AB-StoreEnd End_Object // oRecipientsTabPage Object oAttachmentsTabPage is a TabPage Set Label to "Attachments" Set Tab_ToolTip_Value to "Attachments" Object oAttachedFilesGrid is a cReadOnlyAttachFilesGrid Set Size to 160 273 Set Location to 5 5 Set Line_Width to 2 0 Set Form_Width item 0 to 132 Set Header_Label item 0 to "Files" Set Form_Width item 1 to 132 Set Header_Label item 1 to "Paths" //AB-StoreStart //**************************************************************************** // Description // This method processes all items and for each found filename it will // let the system delete the file. // // $Rev History // 05/30/99 VO Module header created //**************************************************************************** Procedure DoRemoveAttachments Integer iItems iItem iRetval String sFileName Pointer lpsFileName Move (Item_Count (Self) - 1) To iItems For iItem From 0 To iItems Increment iItem Get Value Item iItem To sFileName If (sFileName <> "") Begin GetAddress Of sFileName To lpsFileName Move (DeleteFile (lpsFileName)) To iRetval If (iRetval = 0) Begin Send Stop_Box ("Unable to delete file" * sFileName) "MAPI Remove attachments error" End End Loop End_Procedure // DoRemoveAttachments //**************************************************************************** // Description // This method will wipe out the contents of the grid and will also remove // the temporarily created files. // // $Rev History // 06/02/99 VO Module header created //**************************************************************************** Procedure DoEraseData Send DoRemoveAttachments Send Delete_Data End_Procedure // DoEraseData //AB-StoreEnd End_Object // oAttachedFilesGrid Object oAttachmentCount is a cDisplayOnlyForm Set Label to "Attachments:" Set Size to 13 60 Set Location to 170 219 Set Form_DataType to 0 End_Object // oAttachmentCount //AB-StoreStart //**************************************************************************** // Description // To show the attachments of the current mail message. // // $Rev History // 12/14/99 VO Module header created //**************************************************************************** Procedure DoDisplayAttachments Integer hoMapiSession Integer iCounter iAttachments hoAttachedFilesGrid String sAttachPath sAttachFile Move oAttachedFilesGrid To hoAttachedFilesGrid Send DoEraseData To hoAttachedFilesGrid Get piMessageFileCount Of hoMapiSession To iAttachments Set Value Of oAttachmentCount To iAttachments For iCounter From 1 To iAttachments Get AttachmentPathName Of hoMapiSession iCounter To sAttachPath Get AttachmentFileName Of hoMapiSession iCounter To sAttachFile Send Add_Item To hoAttachedFilesGrid Msg_None sAttachFile Send Add_Item To hoAttachedFilesGrid Msg_None sAttachPath Loop End_Procedure // DoDisplayAttachments //AB-StoreEnd End_Object // oAttachmentsTabPage //AB-StoreStart //**************************************************************************** // Description // // $Rev History // 06/02/99 VO Module header created //**************************************************************************** Procedure Deactivating Send DoEraseData To (oAttachedFilesGrid (oAttachmentsTabPage (Self))) End_Procedure // Deactivating //**************************************************************************** // Description // This method will display the mail information for the current message to // the tabpages. // // $Rev History // 05/31/99 VO Module header created //**************************************************************************** Procedure DisplayMail Integer hoMapiSession Move oMapiSession To hoMapiSession If (hoMapiSession = 0) Begin Send Stop_Box "No MAPI session present!" Procedure_Return End Send DoDisplaySubjectValues To oSubjectTabPage hoMapiSession Send DoDisplayRecipients To oRecipientsTabPage hoMapiSession Send DoDisplayAttachments To oAttachmentsTabPage hoMapiSession End_Procedure // DisplayMail //**************************************************************************** // Description // When the tabdialog is added to the focustree do instruct the system to // display the current mail information. // // $Rev History // 28/05/99 VO Module header created //**************************************************************************** Procedure Add_Focus Integer hoRoot Forward Send Add_Focus hoRoot Send DisplayMail End_Procedure // Add_Focus //AB-StoreEnd End_Object // oTabDialog Object oCloseButton is a Button Set Label to "Close" Set Size to 14 54 Set Location to 210 237 //AB-StoreStart //**************************************************************************** // Description // This method will close the readmail panel. // // $Rev History // 18/09/98 VO Module header created //**************************************************************************** Procedure OnClick Send Close_Panel End_Procedure // OnClick //AB-StoreEnd End_Object // oCloseButton //AB-StoreStart Set Locate_Mode To Center_On_Parent //AB-StoreEnd End_Object // oReadMailPanel //AB/ End_Object // prj