473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C#-WEP/APP: ActiveX Control Permissions

Hello Everybody,

I'm new here, and I'm hoping someone can help me out...

I'm creating an ActiveX control for an company intranet. This control needs to access Microsoft Outlook (specifically the user's contacts folders). I have created a script that can do this, and have also managed to get an activeX control running.

However, when I try to use my Outlook script within my ActiveX control I get a System.Security.Permissions.SecurityPermissions error. I'm assuming that the local machine is not allowing the activeX control to open the outlook folders...

I am able to modify registry keys or outlook/internet explorer configuration on any of the computers that will run the app, but I'm wondering what setting I have to change to grant the activeX control permission to access the outlook folders...

Here is the basic code I am using the access Microsoft Outlook (I am trying to wrap the functionality I need within a class that inherits from System.Windows.Forms.UserControl in order to use a managed ActiveX Control):

Expand|Select|Wrap|Line Numbers
  1. Outlook._Application App = new Outlook.Application();
  2. Outlook._NameSpace NS = App.GetNamespace("MAPI");
  3.  
  4.  
  5. NS.Logon(null, null, false, false);
  6. Outlook.MAPIFolder Contacts = NS.GetDefaultFolderOutlook.OlDefaultFolders.olFolderContacts);
  7. foreach (Outlook._ContactItem Contact in Contacts.Items)
  8. {
  9.        Console.WriteLine(Contact.LastName);
  10. }
  11.  
Any suggestions would be greatly appreciated,

- Loren Van Spronsen
Mar 24 '08 #1
0 1204

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Simon Morris | last post by:
I read that you could add a old Activex Control to VB.NET. I try to add 'Microsoft ADO Data Control 6.0 (SP4) (OLEDB)' and 'Microsoft Hierarchical FlexGrid Control 6.0 (SP4) (OLEDB)' to a form but...
3
by: Neo | last post by:
I have a usercontrol that I am trying to use as an ActiveX Control on a WebPage, however it refereneces an Assembly that whenever the first call is made to anything in the Assembly a Security...
3
by: vanisathish | last post by:
Hi I have a custom ActiveX Control that is working fine with ASP in IIS 5.1 on WinXP. But the same ASP page is failing in Server.CreateObject of that ActiveX Control in IIS 6.0 on Win Server...
2
by: gkelly | last post by:
What is the best soltions for creating a graphical object in c# for use in a C++ app? - I heard some say you can't create an ActiveX control in dotnet and I have heard others say you can using...
2
by: Javier Bertran | last post by:
Hi all, I have an ActiveX control developed in Visual C++ 6.0 that I want to use in a C# project. I want the ActiveX code to run on a separate thread, but can't seem to get it to work. If for...
1
by: None | last post by:
Hello In order to host and use an ActiveX control (non-GUI) in a WTL app, I followed the following steps: 1. During project creation, the ActiveX Hosting option is enabled. 2. In the dialog...
0
by: ann | last post by:
Hi, I am trying to add an ActiveX control on my ASP.NET web form (the language for code behind is C#). I have some client-side vbscript to handle events from the html input buttons. In the...
7
by: Artie | last post by:
Hi, Our team have a web project which includes some C# ActiveX DLLs. On some developers' PCs, the code which calls methods in the ActiveX dll is succesful - no exceptions. On other PCs, the...
0
by: vml | last post by:
Hello, I am trying to mograte from vb 6 to python. I have a very usefull AX control. It can be : -just a bitmap -an active picture where you can plot data and put cursors -a data explorer ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.