PC Review


Reply
Thread Tools Rate Thread

Creating a task in outlook

 
 
=?Utf-8?B?UGFzdHk=?=
Guest
Posts: n/a
 
      23rd Mar 2007
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_Here:
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 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
Use custom task form in Outlook 2003 when creating task in ON 2007 Bobby C Microsoft Access 1 1st Jan 2008 05:39 PM
Creating an Outlook Task Item John Google Microsoft Excel Misc 3 6th Nov 2007 07:58 PM
Creating a task in Outlook from Access Blogd_Node Microsoft Outlook VBA Programming 4 3rd Feb 2007 04:38 AM
Creating a New Outlook 97/200x Task in VB.NET Matt DeJonge Microsoft VB .NET 0 29th Dec 2003 04:55 PM
Creating an Outlook Task Keith Microsoft Access Form Coding 1 21st Sep 2003 03:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:44 PM.