[AccessD] Outlook Tasks and Redemption

Mike & Doris Manning mikedorism at verizon.net
Thu Oct 13 09:30:42 CDT 2005


I'm using Redemption version 2.0.0.516 to create a SafeTaskItem.  When I
display the SafeTaskItem on the screen, all the fields are filled except the
To line.  I specifically gave the Recipients collection an item and resolved
it so I don't understand why the To line is blank.  This doesn't happen when
I'm doing a SafeMailItem so I'm stumped.  Do you have any ideas how I can
resolve this issue?

 

Here is my code.

 

 

Public Sub SendSafeTask(SendTo As String, SendMsg As String, StartDate As
Date, _

        DueDate As Date, SendSubj As String, SendAttach As String, SendEdit
As Boolean)

        

    Dim PullFile As String

    Dim oMail As Object

    Dim oSpace As Object

    Dim oFoldr As Object

    Dim oItem As Object

    Dim oSafe As Object

    Dim oDeliver As Object

    Dim MapiField As Object

    Dim bolOpen As Boolean

    Dim aryRecip() As String

    Dim intRecip As Integer

    Dim aryFileList() As String

    Dim intFilelist As Integer

    Dim strFileName As String

    Dim lcv As Integer

    

    Const olFolderTasks As Integer = 13

    

    Set oMail = CreateObject("Outlook.Application")

    Set oSpace = oMail.GetNamespace("MAPI")

    Set oFoldr = oSpace.GetDefaultFolder(olFolderTasks)

    Set oItem = oFoldr.Items.Add

    Set oSafe = CreateObject("Redemption.SafeTaskItem")

    oSafe.Item = oItem

    

 

    'Add or update the task information

    'to the Outlook TaskItem

    With oSafe

        'Add the TO names

        If SendTo <> vbNullString Then

            .Assign

            If InStr(1, SendTo, ";", vbTextCompare) > 0 Then

                If Right(SendTo, 1) <> ";" Then SendTo = SendTo & ";"

                aryRecip = Split(SendTo, ";")

                intRecip = UBound(aryRecip) - 1

                For lcv = 0 To intRecip

                    .Recipients.Add aryRecip(lcv)

                Next lcv

                Erase aryRecip

                .Recipients.ResolveAll

            Else

                .Recipients.Add SendTo

                .Recipients.ResolveAll

            End If

        End If

        

        .Body = SendMsg

        .StartDate = StartDate

        .DueDate = DueDate

        .Subject = SendSubj

        .ReminderSet = True

        

        'Add Attachments

        If SendAttach <> vbNullString Then

            If InStr(1, SendAttach, ";", vbTextCompare) > 0 Then

                If Right(SendAttach, 1) <> ";" Then

                    SendAttach = SendAttach & ";"

                End If

                aryFileList = Split(SendAttach, ";")

                intFilelist = UBound(aryFileList) - 1

                For lcv = 0 To intFilelist

                    PullFile = aryFileList(lcv)

                    .Attachments.Add PullFile

                Next lcv

            End If

        End If

        

        .Save

    End With

    

    If SendEdit = True Then

        oSafe.display

        Exit Sub

    Else

        oSafe.Send

    End If

 

    Set oDeliver = CreateObject("Redemption.MAPIUtils")

    oDeliver.DeliverNow

    oDeliver.Cleanup

'

'Exit_SafeMail:

'

'    If bolOpen = False Then

'        oMail.Quit

'    End If

'

    Set oDeliver = Nothing

    Set oSafe = Nothing

    Set oItem = Nothing

    Set oFoldr = Nothing

    Set oSpace = Nothing

    Set oMail = Nothing

 

End Sub

 

Doris Manning

mikedorism at verizon.net

 




More information about the AccessD mailing list