Redemption Help

  • Thread starter Thread starter Scott S.
  • Start date Start date
S

Scott S.

I am by no means an Outlook programmer but my company has asked me to create
a simple program that will programmatically assign a task. I have been
toying with code and this code seems to work, but it triggers the Outlook
object modle guard messages. If I can get this code working using the
Redemption dll and avoid those annoying prompts then I it would be a pretty
easy sell to my managers to get them to purchase a distribution version of
Redemption.
your assistance is appreciated

Sub AssignTask()
Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.TaskItem
Dim myDelegate As Outlook.Recipient
Set myItem = myOlApp.CreateItem(olTaskItem)
myItem.Assign
Set myDelegate = myItem.Recipients.Add("Test2")
myDelegate.Resolve
If myDelegate.Resolved Then
myItem.Subject = "Error 505 Fix Printer
myItem.DueDate = Now + 30
myItem.Display
myItem.Send
MsgBox "success"
End If
End Sub

Scott Sommerfeldt
 
Try something like the following (off the top of my head):

Dim myOlApp
dim NS
Dim myItem 'As Outlook.TaskItem
Dim myDelegate 'As Outlook.Recipient
Dim safeItem

set myOlApp = CreateObject("Outlook.Application")
set NS = myOlApp.GetNamespace("MAPI")
NS.Logon
Set myItem = myOlApp.CreateItem(olTaskItem)
Set safeItem = CreateObject("Redemption.SafeAppointmentItem")
safeItem.Item = myItem
Set myDelegate = safeItem.Recipients.Add("Test2")
myDelegate.Resolve
If myDelegate.Resolved Then
safeItem.Subject = "Error 505 Fix Printer"
safeItem.DueDate = Now + 30
safeItem.Send
MsgBox "success"
End If

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Dmitry

Thank-you for your reply. I've heard allot of good things about your
Outlook Redemption. The code you sent works but not as expected. I tryed
to adjust it to be a SafeAppointmentItem and changing a few properties and
it works great, but is it possible to send a task / taskrequest. It seems
like it is really close, but I am missing something critical that won't
enable the tasks to be opened by the recipient. your thoughts are
appreciated.
Sub test()
Dim myOlApp
Dim NS
Dim myItem 'As Outlook.TaskItem
Dim myDelegate 'As Outlook.Recipient
Dim safeItem

Set myOlApp = CreateObject("Outlook.Application")
Set NS = myOlApp.GetNamespace("MAPI")
NS.Logon
Set myItem = myOlApp.CreateItem(olTaskItem)

'---------------> when I make this a Redemption.SafeTaskIt
' It works fine but the recipient does not recieve the task request
' as expected. they get a error when they try to open the task 'request
"Can't open this item. the propery does not exist. the 'feild you want to
modify is not valid for this type of item" ?? 'weird

Set safeItem = CreateObject("Redemption.SafeTaskItem")
safeItem.Item = myItem
Set myDelegate = safeItem.Recipients.Add("Test2")
myDelegate.Resolve
If myDelegate.Resolved Then
safeItem.Subject = "Error 505 Fix Printer"
safeItem.DueDate = Now + 30
safeItem.Send
MsgBox "success"
End If

End Sub
 
What are your versions of Outlook and Exchange? Can you save both good (sent
through Outlook) and bad (sent using Redemption) task requests from the
inbox as MSG files (File|Save As), zip them (important!) and send to my
private e-mail address?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top