outlook task recipient

A

Atishoo

I can send a task to my own outlook but cant set another recipient using the
recipient command (it doesnt like it) (or maybe it just doesnt like me) what
code should I be using instead?

Dim olApp As Outlook.Application
Dim olTsk As TaskItem

Set olApp = New Outlook.Application
Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
..Recipients - ("Salter John")
..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

thanks
 
B

broro183

hi Atishoo,

Sorry, I hadn't read your OP properly & thought you were sending an
email rather than a Task. Unfortunately, Help files aren't installed on
the comuter I'm working on & so I can't easily investigate & test but
hopefully the below links may contain the answer for you to discover:

http://www.*****-clicks.com/excel/olTask.htm
'TaskRequestItem Object'
(http://msdn.microsoft.com/en-us/library/aa211086.aspx)
'Create MS Outlook task object by Excel macro - Excel Help Forum'
(http://tinyurl.com/q9ruea)
'Excel: Sending Outlook tasks via VBA, excel vba, windows xp sp2'
(http://en.allexperts.com/q/Excel-1059/Sending-Outlook-tasks-via.htm)
'Programatically Assign Outlook Task - Page 2'
(http://www.pcreview.co.uk/forums/thread-1838996-2.php)
Post 9 of:
http://www.access-programmers.co.uk/forums/showthread.php?t=79767
'ACC2000: How to Use Automation to Add a Task or a Reminder to
Microsoft Outlook'
(http://support.microsoft.com/default.aspx?scid=kb;en-us;209932)


These were all sourced from: '.CreateItem(olTaskItem) excel sub outlook
recipient - Google Search' (http://tinyurl.com/pez79b)

hth
Rob
 
A

Atishoo

Thankyou for your links have got it as follows thankyou.
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = myItem.Recipients.Add("Jeff Smith")
myItem.Subject = "Prepare Agenda For Meeting"
myItem.DueDate = #9/20/97#
myItem.Send
 
B

broro183

Brilliant, I'm pleased you solved it. Thanks for the feedback & posting
your findings for others to use :)

Rob
 
A

Atishoo

Np Thanks for your help
it is worth noting that the code only works when pasted into the outlook VBE
I think to get it to work via Excell it would have to be recorded as a macro
in outlook then trigger that from excell?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top