//AB/ Project Send Documents dialog //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Send Documents dialog" //AB/ Set ProjectFileName to "SendDocuments.Dg" // Project Object Structure // oSendDocumentsPanel is a ModalPanel // oContainer is a Container3d // oAttachedFilesGrid is a cAttachFilesGrid // oOpenFileDialog is a OpenDialog // oSeparatorForm is a Form // oDeleteRowButton is a Button // oNewRowButton is a Button // oAddFileButton is a Button // oSendButton is a Button // oCancelButton is a Button // Register all objects Register_Object oAddFileButton Register_Object oAttachedFilesGrid Register_Object oCancelButton Register_Object oContainer Register_Object oDeleteRowButton Register_Object oNewRowButton Register_Object oOpenFileDialog Register_Object oSendButton Register_Object oSendDocumentsPanel Register_Object oSeparatorForm //AB-StoreTopStart Use ParseFn.Pkg Use MapiSession.Pkg //AB-StoreTopEnd //AB-IgnoreStart Use cAttachFilesGrid.Pkg //AB-IgnoreEnd Object oSendDocumentsPanel 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 "Send multiple documents" Set Size to 230 297 Set Help_Id to Hlp_Send_Documents_Dialog //AB-DDOStart //AB-DDOEnd Object oContainer is a Container3d Set Size to 190 283 Set Location to 5 5 Object oAttachedFilesGrid is a cAttachFilesGrid Set CurrentCellColor to clYellow Set CurrentRowColor to clLime Set Size to 161 270 Set Location to 5 5 Set Line_Width to 2 0 Set Form_Width item 0 to 131 Set Header_Label item 0 to "Files" Set Form_Width item 1 to 131 Set Header_Label item 1 to "Paths" //AB-StoreStart //**************************************************************************** // Description // This function retrieves all filenames in the column files and returns // them as one string where the names are seperated with the passes // separator. // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Function FileNames String sSeparator Returns String String sFileNames sFileName Integer iItem iItems Move (Item_Count (Self) - 1) To iItems For iItem From 0 To iItems Get Value Item iItem To sFileName Move (Trim (sFileName)) To sFileName If (sFileName <> "") Begin If (sFileNames <> "") Begin Move (sFileNames + sSeparator) To sFileNames End Move (sFileNames - Trim (sFileName)) To sFileNames End Increment iItem Loop Function_Return sFileNames End_Function // FileNames //**************************************************************************** // Description // This function retrieves all pathnames in the column files and returns // them as one string where the names are seperated with a semi-colon. // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Function PathNames String sSeparator Returns String String sPathNames sPathName sFileName sDirSep Integer iItem iItems Move (Sysconf (Sysconf_Dir_Separator)) To sDirSep Move (Item_Count (Self) - 1) To iItems For iItem From 0 To iItems Get Value Item iItem To sFileName Move (Trim (sFileName)) To sFileName Increment iItem Get Value Item iItem To sPathName Move (Trim (sPathName)) To sPathName If (sPathName <> "") Begin If (sPathNames <> "") Begin Move (sPathNames + sSeparator) To sPathNames End If (Right (sPathName, 1) <> sDirSep) Begin Move (sPathName + sDirSep) To sPathName End Move (sPathName + sFileName) To sPathName Move (sPathNames - sPathName) To sPathNames End Loop Function_Return sPathNames End_Function // PathNames //AB-StoreEnd End_Object // oAttachedFilesGrid Object oOpenFileDialog is a OpenDialog Set Dialog_Caption to "Select file(s) to enclose" Set Filter_Index to 2 Set Filter_String to "Zip files|*.zip|All Files|*.*" Set NoChangeDir_State to TRUE End_Object // oOpenFileDialog Object oSeparatorForm is a Form Set Label to "Separator:" Set Size to 13 13 Set Location to 170 42 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Form_Margin Item 0 To 1 Set Value Item 0 To ";" //AB-StoreEnd End_Object // oSeparatorForm Object oDeleteRowButton is a Button Set Label to "&Delete row" Set Size to 14 60 Set Location to 170 92 //AB-StoreStart //**************************************************************************** // Description // This method will cause the current row to be deleted. // // $Rev History // 05/31/99 VO Module header created //**************************************************************************** Procedure OnClick Send DoDeleteCurrentRow To oAttachedFilesGrid End_Procedure // OnClick //AB-StoreEnd End_Object // oDeleteRowButton Object oNewRowButton is a Button Set Label to "&New row" Set Size to 14 60 Set Location to 170 154 //AB-StoreStart //**************************************************************************** // Description // This method will create a new row at the end of the grid // // $Rev History // 05/31/99 VO Module header created //**************************************************************************** Procedure OnClick Integer iItems iColumns hoAttachedFilesGrid Move oAttachedFilesGrid To hoAttachedFilesGrid Send DoAddRow To hoAttachedFilesGrid Move (Item_Count (hoAttachedFilesGrid)) To iItems Get ColumnCount Of hoAttachedFilesGrid To iColumns Set Current_Item Of hoAttachedFilesGrid To (iItems - iColumns) End_Procedure // OnClick //AB-StoreEnd End_Object // oNewRowButton Object oAddFileButton is a Button Set Label to "&Select file" Set Size to 14 60 Set Location to 170 216 //AB-StoreStart //**************************************************************************** // Description // When the user clicks the button we will open the Windows Common File // dialog and let them select one file. The result is copied in the list // of files to be attached. // // $Rev History // 18/09/98 VO Module header created //**************************************************************************** Procedure OnClick Integer bOpen hoOpenFileDialog hoAttachedFilesGrid String sFileName sDrive sPath Move oOpenFileDialog To hoOpenFileDialog Get Show_Dialog Of hoOpenFileDialog To bOpen If (bOpen = Dftrue) Begin Get File_Name Of hoOpenFileDialog To sFileName If (sFileName <> "") Begin Move oAttachedFilesGrid To hoAttachedFilesGrid Get Parse_Path sFileName To sPath Get Parse_Drive sFileName To sDrive Get Parse_File sFileName To sFileName Send Add_Item To hoAttachedFilesGrid Msg_None sFileName Send Add_Item To hoAttachedFilesGrid Msg_None (sDrive - sPath) Send DoDeleteEmptyRows To hoAttachedFilesGrid Set Dynamic_Update_State Of hoAttachedFilesGrid To True End End End_Procedure // OnClick //AB-StoreEnd End_Object // oAddFileButton //AB-StoreStart //**************************************************************************** // Description // This method gathers the documents listed and instructs the mapi system // to send them. // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Procedure DoSendDocuments Integer iRetval hoMapiSession hoAttachedFilesGrid String sFileNames sPathNames sSeparator Move oMapiSession To hoMapiSession Get Value Of oSeparatorForm To sSeparator If (sSeparator = "") Begin Move ";" To sSeparator End Move oAttachedFilesGrid To hoAttachedFilesGrid Get FileNames Of hoAttachedFilesGrid sSeparator To sFileNames Get PathNames Of hoAttachedFilesGrid sSeparator To sPathNames Get SendDocuments Of hoMapiSession sSeparator sPathNames sFileNames To iRetval End_Procedure // DoSendDocuments On_Key Key_Ctrl+Key_D Send KeyAction To oDeleteRowButton On_Key Key_Ctrl+Key_N Send KeyAction To oNewRowButton On_Key Key_Ctrl+Key_S Send KeyAction To oAddFileButton //AB-StoreEnd End_Object // oContainer Object oSendButton is a Button Set Label to "Send" Set Location to 198 185 //AB-StoreStart //**************************************************************************** // Description // Sends a message to the attachfiles grid to send the files out via // SendDocuments. // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Procedure OnClick Send DoSendDocuments To oContainer End_Procedure // OnClick //AB-StoreEnd End_Object // oSendButton Object oCancelButton is a Button Set Label to "Cancel" Set Location to 198 237 //AB-StoreStart //**************************************************************************** // Description // Closes the current panel // // $Rev History // 06/01/99 VO Module header created //**************************************************************************** Procedure OnClick Send Close_Panel End_Procedure // OnClick //AB-StoreEnd End_Object // oCancelButton //AB-StoreStart Set Locate_Mode To Center_On_Parent //AB-StoreEnd End_Object // oSendDocumentsPanel //AB/ End_Object // prj