Create a task and assign it.

W

Walter Levine

I wrote a VB program that scans a database for certain
action dates, expirations, renewals ect.
As records are identified, the program needs to create a
task owned by a supervisor and assigned to a caseworker
(all of whom have accounts on the Exchange Server) It
seems that I need to use Redemption because I get the
security warning if I don't.
My code (doesn't work) is:
**********************
Set Application = New Outlook.Application
Set NameSpace = Application.GetNamespace("MAPI")
NameSpace.Logon gsProfile, gsPassword, False, False
Set SafeTask = CreateObject("Redemption.SafeTaskItem")
Set oTask = Application.CreateItem(olTaskItem)
With SafeTask
.Item=oTask
.Owner="(e-mail address removed)"
.Assign
.Recipients.Add "(e-mail address removed)"
.Recipients.ResolveAll
.Save
.Send
End With
**********************
Can anyone tell me why this code doesn't work??
I am trying to simulate this with a pop3 account, could
that be the problem.
Any help would be greatly appreciated.
Thanks in advance
Walter Levine
 
E

Eric Legault [Outlook MVP]

I don't see anything obviously wrong with your code, and it worked fine for
me. Try adding an error handler and see if it breaks somewhere.

Also, review the following from the VBA help file about some limitations on
the Owner property:

Returns or sets a String indicating the owner for the task. This is a
free-form string field. Setting this property to someone other than the
current user does not have the effect of delegating the task. Read/write if
the task is stored on the Exchange Server public folder. Read-only if it's
stored in a user's mailbox or personal folders file.
 

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