office-pia

Why doesn't the office PIA install correctly to the GAC?

微笑、不失礼 提交于 2019-11-29 05:43:16
I am currently working on a c# project, where I need to access Outlook. The development is being done on two different machines, one of which has office installed, and one of which doesn't. I previously asked how to compile my project against the outlook com object, and one of the comments suggested that I compiled against the office primary interop assembly, or PIA. In my downloaded Office 2007 PIA , there is an msi file, that is supposed to install a number of PIAs for the different parts of Office. My problem is that this seemingly doesn't happen. On my office-less machine, after typing

How to disable popups when opening a file using Microsoft.Office.Interop

↘锁芯ラ 提交于 2019-11-28 08:21:44
Such as read-only confirm, other alerts. What to do with these popups? Or ignore them? dotNetkow See my answer here. Basically, you disable all alerts via the "Display Alerts" method: Microsoft.Office.Interop.[OFFICE_APP].Application app = new Microsoft.Office.Interop.[OFFICE_APP].Application(); app.DisplayAlerts = false; where [OFFICE_APP] is the name of the Office program you're using, such as Word, Excel, etc. Uriel Fernandez Here is another alternative to prevent the Security message asking you to allow macros. I read this article from MSDN and figured out the following code: Application

Why doesn't the office PIA install correctly to the GAC?

ε祈祈猫儿з 提交于 2019-11-27 23:18:18
问题 I am currently working on a c# project, where I need to access Outlook. The development is being done on two different machines, one of which has office installed, and one of which doesn't. I previously asked how to compile my project against the outlook com object, and one of the comments suggested that I compiled against the office primary interop assembly, or PIA. In my downloaded Office 2007 PIA, there is an msi file, that is supposed to install a number of PIAs for the different parts of

RCW & reference counting when using COM interop in C#

谁说我不能喝 提交于 2019-11-27 18:02:16
I have an application that uses Office interop assemblies. I am aware about the "Runtime Callable Wrapper (RCW)" managed by the runtime. But I am not very sure how the reference count gets incremented. MSDN says, RCW keeps just one reference to the wrapped COM object regardless of the number of managed clients calling it. If I understand it correctly, on the following example, using Microsoft.Office.Interop.Word; static void Foo(Application wrd) { /* .... */ } static void Main(string[] args) { var wrd = new Application(); Foo(wrd); /* .... */ } I am passing the instance wrd to another method.