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

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._taskitem' and
Outlook.itemevents.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_attachmentfilenames As ArrayList)

Dim oTaskItem As Outlook.TaskItem

Dim enumer As IEnumerator

Dim attachment_file As String

oTaskItem =
CType(Me.outlook_application.CreateItem(Outlook.Ol ItemType.olTaskItem),
Outlook.TaskItem)

enumer = in_attachmentfilenames.GetEnumerator

While enumer.MoveNext

attachment_file = CType(enumer.Current, String)

oTaskItem.Attachments.Add(attachment_file, Type.Missing, Type.Missing,
attachment_file)

End While

oTaskItem.Assign()

oTaskItem.Recipients.Add(in_torecipients)

oTaskItem.Subject = in_subject

' oTaskItem.Owner = System.Environment.UserName

oTaskItem.Body = in_body

oTaskItem.DueDate = DateTime.Today

oTaskItem.ReminderSet = True

oTaskItem.ReminderTime = oTaskItem.DueDate

oTaskItem.Display(True)

' oTaskItem.Save()

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

End Sub
Nov 19 '05 #1
1 7976
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*@northamericansigns.com> wrote in message
news:uy**************@TK2MSFTNGP09.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._taskitem' and
Outlook.itemevents.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_attachmentfilenames As ArrayList)
Dim oTaskItem As Outlook.TaskItem

Dim enumer As IEnumerator

Dim attachment_file As String

oTaskItem =
CType(Me.outlook_application.CreateItem(Outlook.Ol ItemType.olTaskItem),
Outlook.TaskItem)

enumer = in_attachmentfilenames.GetEnumerator

While enumer.MoveNext

attachment_file = CType(enumer.Current, String)

oTaskItem.Attachments.Add(attachment_file, Type.Missing, Type.Missing,
attachment_file)

End While

oTaskItem.Assign()

oTaskItem.Recipients.Add(in_torecipients)

oTaskItem.Subject = in_subject

' oTaskItem.Owner = System.Environment.UserName

oTaskItem.Body = in_body

oTaskItem.DueDate = DateTime.Today

oTaskItem.ReminderSet = True

oTaskItem.ReminderTime = oTaskItem.DueDate

oTaskItem.Display(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
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...
1
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...
4
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...
3
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
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...
5
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...
3
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. ---------------------...
0
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...
0
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...
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: 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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.