473,406 Members | 2,633 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,406 software developers and data experts.

I'm tring to use Microsoft.Office.Interop.Outlook

I want to develop a aplication with VB.2003 and Microsoft outlook 2003.

I have this code.

Imports OutLook = Microsoft.Office.Interop.Outlook
Imports System.Reflection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oApp As OutLook.Application = New OutLook.Application
End Sub
But when Button1_Click is Execute I reveived a error. What is missing in
this code?
Nov 29 '05 #1
2 2587
Miguel,
What specifically is the error you get.

Try
Dim oApp As OutLook.Application = New OutLook.Application Catch ex As Exception
MessageBox.Show(ex.ToString(), "OutLook.Application")
End Try

What does the MessageBox show? (instead of MessageBox.Show, you can use
Debug.WriteLine so you can cut & paste the complete exception text into your
response.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Miguel Arenas" <Mi**********@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...I want to develop a aplication with VB.2003 and Microsoft outlook 2003.

I have this code.

Imports OutLook = Microsoft.Office.Interop.Outlook
Imports System.Reflection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oApp As OutLook.Application = New OutLook.Application
End Sub
But when Button1_Click is Execute I reveived a error. What is missing in
this code?

Nov 29 '05 #2
Here is the error.

An unhandled exception of type 'System.Security.SecurityException' occurred
in system.windows.forms.dll

Additional information: Security error.

The try doesn't caught the error.

"Jay B. Harlow [MVP - Outlook]" wrote:
Miguel,
What specifically is the error you get.

Try
Dim oApp As OutLook.Application = New OutLook.Application

Catch ex As Exception
MessageBox.Show(ex.ToString(), "OutLook.Application")
End Try

What does the MessageBox show? (instead of MessageBox.Show, you can use
Debug.WriteLine so you can cut & paste the complete exception text into your
response.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Miguel Arenas" <Mi**********@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
I want to develop a aplication with VB.2003 and Microsoft outlook 2003.

I have this code.

Imports OutLook = Microsoft.Office.Interop.Outlook
Imports System.Reflection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oApp As OutLook.Application = New OutLook.Application
End Sub
But when Button1_Click is Execute I reveived a error. What is missing in
this code?


Nov 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ilann | last post by:
I'm trying to use OutLook in my c# application, I add the correct COM reference and I put using Microsoft.Office.Interop.Outlook; on top of my file and I try this:...
2
by: Tarllem | last post by:
Hi! I'm trying to call to the assemblies of Outlook (<% @Import Namespace="Microsoft.Office.Interop.Outlook"%>) but this line shows the message: Can`t find Office inside Microsoft name space....
1
by: Stephen Noronha | last post by:
Hi, I am trying a sample app to send an email from my app I am getting a "type not defined error" I have added "Office and Outlook" COM component but still I am getting this error... Please...
1
by: Tory Collum | last post by:
My code works as a VB.NET executable file. So I'm trying to "adapt" it to a ..NET XML Web Service. As a VB.NET file, I used Microsoft.Office.Core as the reference, and everything was fine, but...
0
by: Mads Westen | last post by:
Hi, I'm trying to code a application that can create a new email in Outlook I have coded my project in VS 2003, but now I have upgraded to VS 2005. I can not build my project anymore, I get a...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
0
by: geethika | last post by:
Warning: The dependency 'Interop.Microsoft.Office.Core, Version=2.3.0.0, Culture=neutral' in project 'csharp' cannot be copied to the run directory because it would overwrite the reference...
4
by: =?Utf-8?B?QXJ0?= | last post by:
Hello, I saw this posting and it is the closest place to ask this question. I am simply trying to create a Word document from a VB application I am wrting with Visual Studio 2005. I cut a...
3
OuTCasT
by: OuTCasT | last post by:
Hi I have created an asp.net project that exports items from datagridview to and outlook calendar This is the code that i have used.. Dim body As String Dim ends As String ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.