473,657 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft.Offic e.Interop.Outlo ok.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.Offic e.Interop.Outlo ok.Application <- type not defined
oApp = New Microsoft.Offic e.Interop.Outlo ok.Application
Dim oMsg As Microsoft.Offic e.Interop.Outlo ok.MailItem

oMsg =
CType(oApp.Crea teItem(Microsof t.Office.Intero p.Outlook.OlIte mType.olMailIte m
), Microsoft.Offic e.Interop.Outlo ok.MailItem)()

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

End Sub
Nov 19 '05 #1
1 6928
"Stephen Noronha" <st********@hot mail.com> wrote in
news:OL******** ******@TK2MSFTN GP14.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********@rog ers.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
1437
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: Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application (); here is the exception I get:
2
11457
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, where, after adding a reference to Microsoft.Office.Core and a reference to Microsoft Word I declare objects as follows: Dim oWordApp As New Microsoft.Office.Interop.Word.Application, . Everything works fine on the development computer...
1
3594
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 when I try to do the same thing as an XML Web Service, VS.NET says my syntax is not defined. Can anyone tell me why the syntax is not defined? <WebMethod()> _ Public Function HelloWorld() As String Try
2
2606
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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
0
2008
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 looooooong error. I can also see, when I add a reference to my project, that the Microsoft.Office.Core and the Outlook References have a yellow exclamation mark. If I remove my reference to the Outlook object model, the code marked with a
2
7292
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 "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
1
2098
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 'System.NullReferenceException' occurred in ConsoleApplication1.exe,Additional information: Object reference not set to an instance of an object .. Can anybody help me pls.... my code is like this..
4
1984
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 pasted a simple routine within the 'click' sub-routine and I'm simple having a problem with resolving the statement 'Dim objWord As New Word.Application' where it is complaining about 'Word.Application' is not defined.
3
11629
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 Dim location As String Dim start As String Dim subject As String
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.