LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Specify an Outlook folder for already successful Task creation procedure

I am using the following to succefully create tasks within Outlook but
only to the default Task folder.
How can I specify to save the task to a particular task folder?

Sub AddTasksToOutlook()
'!! Reference to Outlook object library required !!

Dim olTask As Outlook.TaskItem
Dim olApp As Outlook.Application
Dim lngRow As Long, shtSource As Worksheet

'Get reference to MS Outlook
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If Err.Number < 0 Then
Set olApp = CreateObject("Outlook.Application")
End If
On Error GoTo 0
Set shtSource = ActiveSheet

'Enter number of orders to process in A1
For lngRow = 2 To shtSource.Cells(1, 1).Value + 1
Set olTask = olApp.CreateItem(olTaskItem)
With olTask
.Subject = shtSource.Cells(lngRow, 2) + " " +
shtSource.Cells(1, 3)
.DueDate = CDate(DateValue(shtSource.Cells(lngRow, 3))) ' +
shtSource.Cells(lngRow, 6))
.Categories = "Purchase Orders"
.Save
End With
Next lngRow
End Sub

 
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
Perform task on multiple sheets in a folder [email protected] Excel Programming 19 May 12th 07 03:24 PM
Sending a task from Excel to Outlook Pasty Excel Programming 0 March 28th 07 01:49 AM
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
linking an excel document to my task folder in outlook hallbb1 Excel Discussion (Misc queries) 0 January 10th 05 04:07 AM


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

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

About Us

"It's about Microsoft Excel"