|Event Handler Checking data within Excel file
This is quite a complex task and will require some time and effort to create.
You would need a way for the event handler to read and inspect the excel file on the server, this would require excel to be installed on the server where your custom event handler and open the file, navigate it and do whatever checking you want on the data. However, as I said, this can be complex.
Once the excel file has been validated or rejected, you could then cancel the document upload, via the ItemAdding event /Staus property (https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.speventpropertiesbase.status.aspx[^]).
Some sites to get you started:
* Faster MS Excel Reading using Office Interop Assemblies[^]
* The Office Interop can often be a trap for memory leaks
* Follow the 'double .' rule, If its more than 1 dot, it belongs in its over variable and its own disposing!
var wb = Excel.WorkSheet.Workbook;
var WorkSheet = ExcelObj.WorkSheet;
var workbook = WorkShee.WorkBook;
This allows for such things as:
Which will prevent a bunch of memory leaks and ensure there are not excel.exe's hanging around after your process has finsihed. Memory clean up is important when working with the office interop!
NOTE: Code samples as just that, samples and are not expected to work.
2. Instant Messaging
This is possible depending on what instant messaging system you use. In the past I have written such code for OCS, LCS and Lync.
In essence, you would have an event handler, which sends messages to a custom service, which is/acts as a Bot, which then sends an IM to the person you wish it to (this information would be sent from the event handler, to the custom service).
Hope this helps!
modified 13-Sep-15 20:34pm.
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.