netoffice

Running out of memory looping through mail items

て烟熏妆下的殇ゞ 提交于 2021-02-07 08:51:41
问题 Hi I have a Outlook com addin that is doing some simple searching tricks for me. I am part way through putting it together but I am having issues with it running out of memory. The process is very simple and basically loops through an outlook folder checking each mailItem for a match. given the loop reinitialize the variables each time I would have expected the garbage collector to keep up but when I watch the memory it loses ~10m/sec until the system is out of memory and I get unhandled

Running out of memory looping through mail items

蓝咒 提交于 2021-02-07 08:48:02
问题 Hi I have a Outlook com addin that is doing some simple searching tricks for me. I am part way through putting it together but I am having issues with it running out of memory. The process is very simple and basically loops through an outlook folder checking each mailItem for a match. given the loop reinitialize the variables each time I would have expected the garbage collector to keep up but when I watch the memory it loses ~10m/sec until the system is out of memory and I get unhandled

Running out of memory looping through mail items

旧巷老猫 提交于 2021-02-07 08:47:33
问题 Hi I have a Outlook com addin that is doing some simple searching tricks for me. I am part way through putting it together but I am having issues with it running out of memory. The process is very simple and basically loops through an outlook folder checking each mailItem for a match. given the loop reinitialize the variables each time I would have expected the garbage collector to keep up but when I watch the memory it loses ~10m/sec until the system is out of memory and I get unhandled

Getting Range coordinates only for Ranges on the screen

泪湿孤枕 提交于 2020-01-15 06:51:06
问题 I am currently using the following method to find the coordinates of a Range within a document: private Rectangle GetRangeCoordinates(Window w, Range r) { int left = 0; int top = 0; int width = 0; int height = 0; w.GetPoint(out left, out top, out width, out height, r); return new Rectangle(left, top, width, height); } This works really well unless the Range is off the screen by a fairly large margin (quite a few pages), in which case I get the following exception: System.Runtime

Excel User Defined Function Locks Invoking Spreadsheet

别说谁变了你拦得住时间么 提交于 2019-12-11 10:41:53
问题 I am using NetOffice to edit an Excel Spreadsheet. If I call the code from an Excel user defined function it will not let me edit the invoking spreadsheet. Excel.Application excelApplication = Excel.Application.GetActiveInstance(); Excel.Worksheet workSheet = (Excel.Worksheet) excelApplication.ActiveSheet; Excel.Range cell = workSheet.Cells[2, 2]; object value = cell.Value; //works cell.Value = 3; //Throws Exception is there a workaround that will enable me to do this? The exception is

Detect password protected word file

半城伤御伤魂 提交于 2019-12-01 01:10:40
I am using "netoffice" library for extracting the text from word files. This should be automated process. However, when the word file is password protected, the alert windows is shown so the user needs to enter the password. Because this is automated process, the user does not enters the password, and the program stops here. How can I detect if the word file is password protected with "netoffice", and if this is not possible, how can I disable the alert windows from showing up? I tried setting DisplayAlerts to WdAlertLevel.wdAlertsNone, but it isn't working. The following piece of code will

Detect password protected word file

谁说我不能喝 提交于 2019-11-30 19:06:29
问题 I am using "netoffice" library for extracting the text from word files. This should be automated process. However, when the word file is password protected, the alert windows is shown so the user needs to enter the password. Because this is automated process, the user does not enters the password, and the program stops here. How can I detect if the word file is password protected with "netoffice", and if this is not possible, how can I disable the alert windows from showing up? I tried