• Dual-updatable tasks (A2k)

    Author
    Topic
    #430453

    I create tasks through code since they’re extremely repetitive. I would like to share them between myself and another worker, and let us both be able to update/complete them. My code is below, can anyone give me some advice?

    Private Sub btnCreate_Click()
    Const intNumTasks As Integer = 10
    Const strTaskSubj As String = “Graduation day;Complete grad package; Copies of orders to travel; Pull SRBs for grad packages; Medical/Dental Letter to Kirk; ” & _
    “Orders Brief; Schedule Overseas Physicals; Create Orders and Medical/Dental Record letter; ” & _
    “Book port calls; Check for web orders”
    Const strDaysPrior As String = “0;2; 6;7;7;7 ; 14; 20; 20; 30”
    Dim itmTask As TaskItem
    Dim dateDue As Date
    Dim intC As Integer
    Dim x As String
    Dim y As String

    x = InputBox(“Who do you want to assign the task to? Type their user name in the box below. Example: hazlettjm”, “Assign to who?”)
    y = InputBox(“Who else do you want to assign the task to? Type their user name in the box below. Example: hazlettjm”, “Assign to who?”)

    If Not IsDate(txtGradDate) Then
    txtGradDate = “”
    Exit Sub
    End If

    For intC = 0 To intNumTasks – 1
    Set itmTask = Outlook.CreateItem(olTaskItem)
    With itmTask
    dateDue = DateAdd(“D”, -CInt(Split(strDaysPrior, “;”, -1, vbTextCompare)(intC)), txtGradDate)
    If Weekday(dateDue) = 1 Then dateDue = dateDue – 2 ‘ move Sun to preceding Fri
    If Weekday(dateDue) = 7 Then dateDue = dateDue – 1 ‘ move Sat to preceding Fri

    .DueDate = dateDue ‘ due date, not reminder date
    .Subject = txtClassName & ” – ” & Split(strTaskSubj, “;”, -1, vbTextCompare)(intC)
    .Categories = txtClassName & “Grad Class Tasks”
    .Body = “Reminder to complete”
    .ReminderTime = DateAdd(“D”, -1, dateDue) + 8 / 24 ‘ 8: 00 AM day before due
    .Assign
    If x = “” Then
    ‘do nothing
    Else
    .Recipients.Add x
    End If
    If y = “” Then
    ‘do nothing
    Else
    .Recipients.Add y
    End If
    .Save
    If x = “hazlettjm” Then
    ‘do nothing
    Else
    .Send
    End If
    End With

    Next intC
    Unload Me
    End Sub

    Viewing 0 reply threads
    Author
    Replies
    • #1005116

      As a secondary thought, is there a way to make a shared Task folder my default task folder? I know I can give permissions to my folder to another user, but then how do I make that easily accessible to him? (Click of a button, make the folder show in his folder list, etc?)

      • #1005148

        Not sure how Tasks are shared, but you should be able to delegate Permissions to each other; for example you could permit each other to view and change but not create a Task. (Outlook has focused on sharing Calendars more than sharing Tasks.)

        Regarding your first post, the question isn’t really clear. What are you trying to do? As you know from the .Assign command, you .Assign to Recipients just as you do with Messages. You’ll find a few code samples in here. One frustration with Outlook’s Object Model is that it doesn’t have a way to pop an address dialog in VBA; redemption may offer a way. However, you could pop the Contacts Folder and extract the email addresses from there, then use the .ResolveAll Method – the coding will be a bit of work.

        • #1005157

          Basically, I don’t want to have an owner/assigner relation to the task; I just want both of us to be able to see the task and work on it, update the comments as necessary and show complete for both of us when one of us completes it.

          • #1005163

            hmmn Calendar Items all have an originator, the person who creates them, with the special and limited exception that someone who is delegated full rights to create as a delegate (usually an assistant) can create them on behalf of the originator. But I see that in Tasks, the .Owner is a read/write Property. (And I’m quite surprised to find that it’s different from a Calendar Item, where, as in Highlander, there can be only one … originator. You might see what you can do with the .Owner and .Role Properties; it won’t be long before you know more about Task Properties than me (not that that would be anything to brag about laugh).

            Deep down I suspect that if you poked into Task Item MAPI Properties with Outlook Spy, you find that you can’t really change the Task Owner.

            • #1005167

              [indent]


              there can be only one


              [/indent]

              groan LoL, thanks for the info. I suppose the permissions route will have to suffice…could I create some sort of network tasks folder that my whole office could view?

    Viewing 0 reply threads
    Reply To: Dual-updatable tasks (A2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: