How to disable security pop ups of MS Outlook using C#? I am getting the security pop up, while trying to initiate outlook task to be created using my c# application. (Using Microsoft Office Outlook 11.0 Object Library))
Screen would looks like
alt text http://img248.imageshack.us/img248/开发者_C百科2988/securitypopup.jpg
Thanks
I had to deal with this same issue trying to send Outlook email from Access. I used Outlook Redemption, a third-party COM library that wraps the calls to Outlook and avoids those annoying popups. It is free unless you want to redistribute it, in that case you would need to buy the redistributable version for $199.
How Outlook Redemption works
Redemption is a regular COM library; once registered on the system, it is accessible to any programming language (VB, VBA, VC++, Delphi, etc). Redemption uses Extended MAPI (which is not affected by the Security Patch since it is not accessible to the scripting languages) to duplicate the functionality blocked by the Security Patch. All Safe*Item Redemption objects have an Item property which must be set to an Outlook item. Once set, you can access any properties and methods, both blocked and not blocked. For the blocked properties and functions, Redemption objects completely bypass the Outlook object model and behave exactly like Outlook objects with no Security Patch applied. For the properties and methods not blocked by the Security Patch, all calls are transparently forwarded to the Outlook object that you assign to the Item property. With this approach changes to your code are minimal: you only change the way you declare the objects, but not the rest of your code that actually accesses both blocked and not blocked properties and methods.
I've used a component of Add-In Express to get around this issue. It's only $150.
I had a similar problem and I wrote a method to click on the dialog window whenever it appears: Defeating 'A program is trying to access email' with SendMessage. My method runs in a continuous loop in a separate thread, checking for the darned security window every second or so. There is a problem with my code in that it's not clicking on the Allow button properly. Hoping to resolve this issue soon. Anyone else wrote their own solution?
精彩评论