Results 1 to 14 of 14
  1. #1
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Copy Appointment (2003)

    I want to copy the data in an appointment and create a new task with it. How can I do this?

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

    Re: Copy Appointment (2003)

    Drag the Appointment from the Calendar to the Task bar or Folder; the Task will be started for you. Because not all Task fields crosswalk, not all Task Fields will be created, so you will need to edit the Task to complete it.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    Thanks for your reply, John - I want to use vba, I know how to create a task and fill in the fields (in vba) just don't know how to get the data from the fields of an appointment.

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

    Re: Copy Appointment (2003)

    <P ID="edit" class=small>(Edited by JohnBF on 29-Aug-08 16:01. Added code.)</P>John, Loungers will be happy to help you, but understand that the Outlook VBA Objects for Task and Appointment Properties (Fields) don't correspond. So after you automatically created the Task, there would still be missing fields. Get into the VBA Help and look at the two objects. Here's some starter code which may help:

    Sub CvtApptToTask()
    Dim itmAppt As Object, itmNewTask As Outlook.TaskItem

    On Error Resume Next
    If TypeName(Application.ActiveWindow) = "Explorer" Then
    Set itmAppt = ActiveExplorer.Selection(1)
    Else
    Set itmAppt = ActiveInspector.CurrentItem
    End If

    If Not itmAppt Is Nothing Then
    If itmAppt.Class = olAppointment Then
    Set itmNewTask = Application.CreateItem(olTaskItem)
    With itmNewTask
    .Subject = itmAppt.Subject
    .Body = itmAppt.Body
    .Save
    .Display
    End With
    End If
    End If
    End If

    Set itmNewTask = Nothing
    Set itmAppt = Nothing
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    Thanks, John. Yes, I had looked at VBA Help and from that, as I mentioned, I know how to create a task but I can't find anything about how to reference the fields of an existing appointment. This is what I'm hoping to be able to do, 'read' the fields of an appointment into variables then use those variables to create a task. John

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

    Re: Copy Appointment (2003)

    > 'read' the fields of an appointment into variables then use those variables to create a task

    Only a few of the fields in an Appointment will map to a Task, including Subject and Body, and I already showed how to copy those over in VB code.

    An Appointment will not have the following common Task Fields: Due Date, Start Date, Reminder Date and Time, and % Complete, unless they are in the Body of the Appointment in a structured format. If so, you would need to locate each field through the use of Instr() and other VB text manipulation methods.
    -John ... I float in liquid gardens
    UTC -7ąDS

  7. #7
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    So are the fields that are not common to 'Task' invisible to VB?

  8. #8
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    Suppose I had a form with enough textboxes for all the fields of an appointment, how could I populate those textboxes with the data from the fields of that appointment?

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

    Re: Copy Appointment (2003)

    No, but the default Appointment Properties do not correspond to the default Task Properties. Default Appointments do not carry Due Date, Start Date, Reminder Date and Time, and % Complete fields.
    -John ... I float in liquid gardens
    UTC -7ąDS

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

    Re: Copy Appointment (2003)

    Yes, you can do that.

    It's a significant change from your original question, which was about getting a Task from an Appointment. (Within Outlook, an Appointment is something that is already in the Calendar, a Meeting Request is what is mailed; they are not the same Object.)

    A non-Default emailed form can have whatever forms you want, and you can import the contents to a Task. That will be a significant design and coding exercise.

    Before you go down that road, have you thought about using Assigned Tasks? It might be simpler than creating and coding a Form which contains Task content..
    -John ... I float in liquid gardens
    UTC -7ąDS

  11. #11
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    John, these are the appointment fields that I want to get the data to populate the textboxs in my form: Subject, Location, Start Time (Date and Hour), End Time (Date and Hour) and Body. How do I do that. John

  12. #12
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    John, I've already created the form that will use the data contain in it's textboxes to create a new task... just need to fill in those boxes without re-keying. John

  13. #13
    Lounger
    Join Date
    Apr 2001
    Location
    Rockvale, Tennessee, USA
    Posts
    42
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copy Appointment (2003)

    John, I've got it.
    Application.ActiveInspector.CurrentItem
    Thanks for help.

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

    Re: Copy Appointment (2003)

    The five lines in <post:=730,433>post 730,433</post:> after "On Error..." will give you or the user the option of using the currently open item, or the item selected in the Explorer Window.

    See this and this article in outlookcode.com for some guidance in using user defined fields.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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