PC Review


Reply
Thread Tools Rate Thread

Create an Outlook Task

 
 
Steven
Guest
Posts: n/a
 
      8th Sep 2008
I want to set up a task through excel.
I get an error:
User defined type not defined on the objTask As Outlook.TaskItem
on the following.

Sub createTask()
Dim objTask As Outlook.TaskItem
Set objTask = OutApp.CreateItem(olTaskItem)
With objTask
.StartDate = "05/30/2008"
.DueDate = "05/31/2008"
.Subject = "Testing Task"
.Body = "Testing Task"
.Assign
.Recipients = "Employee Name"
.Send
End With
Set objTask = Nothing
End Sub


How do I correct this?

Thank you,

Steven
 
Reply With Quote
 
 
 
 
dan dungan
Guest
Posts: n/a
 
      8th Sep 2008
Hi Steven,

In the vbe under tools, is the reference set to Microsoft Outlook 9.0
Object Library?

Dan
 
Reply With Quote
 
dan dungan
Guest
Posts: n/a
 
      8th Sep 2008
Hi Steve,

When I tried the code sample

I had to dim ol and ns

so I did it like this:
Const olFolderTasks = 13

Dim ol As Application
Dim ns As NameSpace
Dim r As Integer
Dim x As Integer

Excel returned the compile error: Assignment to a constant not
permitted on

Set olFolder = ns.GetDefaultFolder(olFolderTasks)

Should I have done something differently?

Dan
 
Reply With Quote
 
dan dungan
Guest
Posts: n/a
 
      10th Sep 2008
Hi Steve,

I'm using Excel 2000. That probably explains it.

Thanks,

Dan
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create a outlook task =?Utf-8?B?UHJpbmNlc3M=?= Microsoft Outlook 0 25th Jan 2006 04:17 PM
Cannot create new task in Outlook =?Utf-8?B?RmlsYSBBbGVz?= Microsoft Outlook Discussion 0 2nd Dec 2004 03:09 PM
Create a Task in Outlook using ASP.NET & C# =?Utf-8?B?UHJhc2FkIFBhdGls?= Microsoft Dot NET 0 10th Aug 2004 10:55 AM
RE: How can I create an Outlook Task on the fly ? =?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ== Microsoft Outlook VBA Programming 5 27th Jul 2004 09:16 PM
RE: Create Outlook Task with ASP.net MSFT Microsoft Dot NET 0 2nd Dec 2003 10:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.