473,659 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send an Outlook Task Through a VB app in background

Hi all!

I'm a VB newbie, and trying to send an Outlook Task automatically without
user intervention in a VB application. When I use the following code, if I
enable the send portion (see code below) , I get an error saying "Send is
ambiguous across the inherited interfaces 'Outlook._taski tem' and
Outlook.itemeve nts.event'.

Any help would be appreciated!

Thanks

Rob
Public Sub SendTask(ByVal in_torecipients As String, ByVal in_subject As
String, ByVal in_body As String, ByVal in_attachmentfi lenames As ArrayList)

Dim oTaskItem As Outlook.TaskIte m

Dim enumer As IEnumerator

Dim attachment_file As String

oTaskItem =
CType(Me.outloo k_application.C reateItem(Outlo ok.OlItemType.o lTaskItem),
Outlook.TaskIte m)

enumer = in_attachmentfi lenames.GetEnum erator

While enumer.MoveNext

attachment_file = CType(enumer.Cu rrent, String)

oTaskItem.Attac hments.Add(atta chment_file, Type.Missing, Type.Missing,
attachment_file )

End While

oTaskItem.Assig n()

oTaskItem.Recip ients.Add(in_to recipients)

oTaskItem.Subje ct = in_subject

' oTaskItem.Owner = System.Environm ent.UserName

oTaskItem.Body = in_body

oTaskItem.DueDa te = DateTime.Today

oTaskItem.Remin derSet = True

oTaskItem.Remin derTime = oTaskItem.DueDa te

oTaskItem.Displ ay(True)

' oTaskItem.Save( )

'oTaskItem.Send () <- this is where the error occurs.

End Sub
Nov 19 '05 #1
1 7986
Rob,
The following web site contains a plethora of information on using the
Outlook object model from VB.NET.

http://www.microeye.com/resources/res_outlookvsnet.htm

Hope this helps
Jay

"Rob McCaughey" <rl*@northameri cansigns.com> wrote in message
news:uy******** ******@TK2MSFTN GP09.phx.gbl...
Hi all!

I'm a VB newbie, and trying to send an Outlook Task automatically without
user intervention in a VB application. When I use the following code, if I
enable the send portion (see code below) , I get an error saying "Send is
ambiguous across the inherited interfaces 'Outlook._taski tem' and
Outlook.itemeve nts.event'.

Any help would be appreciated!

Thanks

Rob
Public Sub SendTask(ByVal in_torecipients As String, ByVal in_subject As
String, ByVal in_body As String, ByVal in_attachmentfi lenames As ArrayList)
Dim oTaskItem As Outlook.TaskIte m

Dim enumer As IEnumerator

Dim attachment_file As String

oTaskItem =
CType(Me.outloo k_application.C reateItem(Outlo ok.OlItemType.o lTaskItem),
Outlook.TaskIte m)

enumer = in_attachmentfi lenames.GetEnum erator

While enumer.MoveNext

attachment_file = CType(enumer.Cu rrent, String)

oTaskItem.Attac hments.Add(atta chment_file, Type.Missing, Type.Missing,
attachment_file )

End While

oTaskItem.Assig n()

oTaskItem.Recip ients.Add(in_to recipients)

oTaskItem.Subje ct = in_subject

' oTaskItem.Owner = System.Environm ent.UserName

oTaskItem.Body = in_body

oTaskItem.DueDa te = DateTime.Today

oTaskItem.Remin derSet = True

oTaskItem.Remin derTime = oTaskItem.DueDa te

oTaskItem.Displ ay(True)

' oTaskItem.Save( )

'oTaskItem.Send () <- this is where the error occurs.

End Sub

Nov 20 '05 #2

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

Similar topics

40
11850
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the following import win32com.client
1
1869
by: Eric Nelson | last post by:
Experienced, but first time outlook programmer asks... Each day I get an e-mail containing a gzipped tar archive as an attachment. I'd like an automated way to (1) save the archive as-is in a particular folder and (2) unpack the archive with gunzip & tar, either directly from the mail message or from its saved location in step 1. Sorry to ask such a vague question, but there seem to be a zillion ways to think about doing this--outlook...
4
4173
by: digger27 | last post by:
I am trying to progamatically create tasks in Outlook using VB.Net. I am using the following code: **** Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim olApp As Outlook.Application Dim olNS As Outlook.NameSpace Dim olFolder As Outlook.MAPIFolder Dim olTaskItem As Outlook.TaskItem Dim strbodyText As String
3
1164
by: Sidney | last post by:
How to make the system sending a job to MS Oulook by using VB.NET programming? thanks a lot~ Sidney
0
1862
by: Tim M | last post by:
Hi, Does anyone know if its possible to send an Outlook task from an ASP page running on a Windows 2000 Server on an intranet. There is also Microsoft Exchange Server on the same network which handles Outlook mailboxes. The Windows 2000 server will soon be upgraded to Wndows 2003, if that makes a difference. All help appreciated.
5
2450
by: Sean | last post by:
Hi... I want to use the macro/sendobject (or any other procedure) to send the contents of a table (very small, ~5 rows/columns) as an Outlook message body, not as an attachment. Access 2000 will not allow "Send To Mail Recipient" (as opposed to "send as attachment") for tables. Needless to say, every other MS application (Word, Excel, etc) let's me send anything I want as a message body. Outlook lets me import anything as a message...
3
3407
by: mwolowski | last post by:
Hello, I'd like to add tasks, appointments, etc using c# to outlook For example i added reference using OutLook = Microsoft.Office.Interop.Outlook; and the code: 1. --------------------- OutLook._Application outlookObj = new OutLook.Application();
0
1314
by: guy | last post by:
I was wondering whether SteveMoren was able to send Outlook task using ASP.NET? If so, could he provide the code. That would be greatly appreciated. EggHeadCafe.com - .NET Developer Portal of Choice http://www.eggheadcafe.com
0
1080
by: BuntyJ | last post by:
I have made an mail application to send mail. I am using richtextbox ver.5 for the body of mail. Most of the things is going fine, but i am facing one problem as follow: When user open an outlook mail and click on reply or ReplyToAll, outlook put previous message body in mail and insert an horizontal line (this line may be an image). When user copy this mail body and paste on richtextbox. It dont behave and look as this is in outlook. Andalso...
0
8428
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
8335
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,...
0
8747
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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
8627
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
7356
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...
1
6179
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.