ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   outlook task (https://www.excelbanter.com/excel-programming/428734-outlook-task.html)

Atishoo

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

Ron de Bruin

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


Atishoo

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



Ron de Bruin

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



Atishoo

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



Dave Peterson

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

Atishoo

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




All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com