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

Hi there I have code (at bottom of message) which allows me to create a task
in my outlook account and it is all working perfectly. How do I tweak it so
a) it puts the body as the action outstanding (situated in column u)
b) it sends the task if there is a month until the action needs to be
completed as a reminder (due dates for actions are in column v)
c) it goes down the list and checks each ones action due date (if they have
one) to see if it a task is required
d) it assigns them to other peoples e-mail accounts (all the relevant names
are situated in column C which tie up with their e-mail names)


Sub Create_Task_and_email_it_to_recipient()
Dim olApp As Outlook.Application
Dim olTask As Outlook.TaskItem
Dim Subject As String
Dim Body As String

Dim wbBook As Workbook
Dim wsMain As Worksheet

Set wbBook = ThisWorkbook
Set wsMain = wbBook.Worksheets("Risk By Function")

With wsMain
Subject = "Non-Financial Risk Actions due"
Body = .Cells(4, 3).Value
End With

On Error GoTo Error_Handling
Set olApp = GetObject(, "Outlook.Application")
Set olTask = olApp.CreateItem(3)

Application.ScreenUpdating = False

With olTask
..Subject = Subject
..Body = Body
..Save
End With


Application.ScreenUpdating = True

MsgBox "The task added into Outlook Tasklist and addressed by email to
Recipient successfully.", vbInformation

Exit_He
Set olTask = Nothing
Set olApp = Nothing
Exit Sub

Error_Handling:
If Err.Number = 429 And olApp Is Nothing Then
Set olApp = CreateObject("Outlook.Application")
Resume Next
Else
MsgBox "Error No: " & Err.Number & "; Description: "
Resume Exit_Here
End If
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
Is there a way to link a cell (only) to an Outlook task? Paul Excel Worksheet Functions 0 January 3rd 08 09:19 PM
Creating an Outlook Task Item John Google Excel Discussion (Misc queries) 3 November 6th 07 07:58 PM
Creating a task in Outlook from a date in Excel Jamie@Wildcard Excel Discussion (Misc queries) 3 July 3rd 07 04:54 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 10:54 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"