Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dual-updatable tasks (A2k)

    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
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dual-updatable tasks (A2k)

    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?)
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Dual-updatable tasks (A2k)

    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.
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dual-updatable tasks (A2k)

    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.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Dual-updatable tasks (A2k)

    <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15> 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 <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>).

    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.
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dual-updatable tasks (A2k)

    <hr>there can be only one<hr>

    <img src=/S/groan.gif border=0 alt=groan width=16 height=15> 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?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •