By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.