Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default outlook task

Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default outlook task

Have you set a reference to Outlook in the VBA ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default outlook task

er ahem no!
how might I do that??
thanks

"Ron de Bruin" wrote:

Have you set a reference to Outlook in the VBA ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default outlook task

1) Go to the VBA editor, Alt -F11
2) ToolsReferences in the Menu bar
3) Place a Checkmark before Microsoft Outlook ? Object Library
? is the Excel version number


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
er ahem no!
how might I do that??
thanks

"Ron de Bruin" wrote:

Have you set a reference to Outlook in the VBA ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default outlook task

Thanks: References is blanked out in grey not sure why? the code is being
used in a class module if that makes a difference

"Ron de Bruin" wrote:

1) Go to the VBA editor, Alt -F11
2) ToolsReferences in the Menu bar
3) Place a Checkmark before Microsoft Outlook ? Object Library
? is the Excel version number


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
er ahem no!
how might I do that??
thanks

"Ron de Bruin" wrote:

Have you set a reference to Outlook in the VBA ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default outlook task

Make sure you're not running/stepping through any code when you do this.



Atishoo wrote:

Thanks: References is blanked out in grey not sure why? the code is being
used in a class module if that makes a difference

"Ron de Bruin" wrote:

1) Go to the VBA editor, Alt -F11
2) ToolsReferences in the Menu bar
3) Place a Checkmark before Microsoft Outlook ? Object Library
? is the Excel version number


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
er ahem no!
how might I do that??
thanks

"Ron de Bruin" wrote:

Have you set a reference to Outlook in the VBA ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub



--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default outlook task

yeah success thanks! Have had a look at your sight too! its very good!

"Ron de Bruin" wrote:

1) Go to the VBA editor, Alt -F11
2) ToolsReferences in the Menu bar
3) Place a Checkmark before Microsoft Outlook ? Object Library
? is the Excel version number


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
er ahem no!
how might I do that??
thanks

"Ron de Bruin" wrote:

Have you set a reference to Outlook in the VBA ?

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Atishoo" wrote in message ...
Everyone seems to feel that this is the sub for creating a new task in
outlook:-
I keep getting the error message "user defined type not defined"
any ideas where im going wrong?



Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.Subject = "Update Web Site"
.Status = olTaskInProgress
.Importance = olImportanceHigh
.DueDate = DateValue("06/26/03")
.TotalWork = 40
.ActualWork = 20
.Save
End With

Set olTsk = Nothing
Set olApp = Nothing

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create an Outlook Task Steven Excel Programming 5 September 10th 08 05:59 PM
export to outlook task list... [email protected] Excel Programming 4 June 21st 07 08:40 PM
Creating a task in outlook Pasty Excel Programming 0 March 23rd 07 02:07 PM
OutLook Task and Appointment Ben Excel Programming 1 January 7th 07 10:22 PM
Importing task description to outlook P.hamsa Excel Discussion (Misc queries) 1 February 28th 05 05:33 PM


All times are GMT +1. The time now is 07:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"