Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Sending task to Outlook from Excel

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
Sending information from a cell in excel to a task in outlook Pasty Excel Programming 0 April 20th 07 03:40 PM
Sending a task from Excel to Outlook Pasty Excel Programming 0 March 28th 07 01:49 AM
How can i have Excel automatically set an Outlook task? VT Excel Discussion (Misc queries) 0 July 31st 06 11:49 AM
disregard the Outlook dialog box sending task/eMail from Excel 2003 jC! Excel Programming 6 May 28th 04 12:38 AM
import outlook task to excel stabekk Excel Programming 1 November 18th 03 06:01 PM


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

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"