473,386 Members | 1,827 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,386 software developers and data experts.

Microsoft.Office.Interop.Outlook.Application

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 advice,
Stephen
Public Sub test()
Dim oApp As Microsoft.Office.Interop.Outlook.Application <- type not defined
oApp = New Microsoft.Office.Interop.Outlook.Application
Dim oMsg As Microsoft.Office.Interop.Outlook.MailItem

oMsg =
CType(oApp.CreateItem(Microsoft.Office.Interop.Out look.OlItemType.olMailItem
), Microsoft.Office.Interop.Outlook.MailItem)()

oMsg.Subject = "Hello!!!"
oMsg.Body = "Hello World"
oMsg.To = me@gmail.com
oMsg.Send()

End Sub
Nov 19 '05 #1
1 6910
"Stephen Noronha" <st********@hotmail.com> wrote in
news:OL**************@TK2MSFTNGP14.phx.gbl:
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 advice,
Stephen

Do you have Office installed on your server?

Also... do you have to use the Interop components? Might be better to send
through the basic mail classes - it'll definately be more reliable.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #2

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: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability,...
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...
2
by: Miguel Arenas | last post by:
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...
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...
1
by: mary mathews | last post by:
Hi, I'm getting an exception while tried to retrive an outlook contact using asp.net in a console application. The exception is as follows: An unhandled exception of type...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.