Example of using MarkAsTask?

M

M O J O

Hi,

(I'm using vb.net 2005)

I'm trying to send an email and mark the "follow up".

Here's my code...

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim oApp As New Microsoft.Office.Interop.Outlook.Application
Dim oNs As Outlook.NameSpace = oApp.GetNamespace("mapi")
oNs.Logon("Outlook", Missing.Value, False, True)
Dim mail As Outlook.MailItem =
CType(oApp.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)

With mail
.Subject = "TEST"
.To = "(e-mail address removed)"
.Body = "Bla bla"
.BodyFormat = Outlook.OlBodyFormat.olFormatPlain
.MarkAsTask(Outlook.OlMarkInterval.olMarkNextWeek)
.TaskStartDate = Now.AddDays(1)
.TaskDueDate = Now.AddDays(1)
.Send()
End With
End Sub

I get an exeption that "MarkAsTask" can't be set, because the mail has not
been sent/recieved.

Any idea how to set MarkAsTask (example code would be GREAT!).

Thanks!

M O J O
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top