Results 1 to 3 of 3
  1. #1
    marciehen is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2

    Access and Outlook Tasks HELP!


    It's been a few years since I played around in VBA and I'm feeling rusty.
    I have a little database for tracking project expiration/due dates. I am wanting to use the data I have entered in a form to make a task in outlook when I click a button on the form.

    I've been digging through the net and found the following:
    Function AddOutLookTask()
    Dim appOutLook As Outlook.Application
    Dim taskOutLook As Outlook.TaskItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set taskOutLook = appOutLook.CreateItem(olTaskItem)
    With taskOutLook
    .Subject = "Expiration Approaching"
    .Body = "text of body here"
    .ReminderSet = True
    .ReminderTime = DateAdd("n", 2, Now)

    .DueDate = DateAdd("n", 5, Now)

    .ReminderPlaySound = True
    'add the path to a .wav file on your computer.
    .ReminderSoundFile = "C:\Win95\media\ding.wav"
    .Save
    End With
    End Function

    But when I try to specify the form and fields where I want to pull the data from, I get errors or it doesn't pull anything at all.

    I'd like to pull Due Date, Reminder Date, Subject, and Body from the form.
    Suggestions?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It's hard to know what's going wrong without seeing what you're doing. Can you post the code as modified?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    marciehen is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2

    I think I've got it. Any suggestions?

    Ok, I think I have it now. Not real pretty but functional.

    Is there a better way to set the reminder date (ReminderTime)? I have it set to remind a week before the DueDate but it's in minutes technically. Just wondering if there is a better way.

    Function AddOutLookTask()
    Dim appOutLook As Outlook.Application
    Dim taskOutLook As Outlook.TaskItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set taskOutLook = appOutLook.CreateItem(olTaskItem)
    With taskOutLook
    .Subject = "Temporary Broker Expiration"
    .Body = "Check Broker Status for " & [Forms]![NewTempBroker]![LastName] & ", " & [Forms]![NewTempBroker]![FirstName]
    .ReminderSet = True
    .ReminderTime = DateAdd("n", -10080, [Forms]![NewTempBroker]![ExpireDate])
    .DueDate = [Forms]![NewTempBroker]![ExpireDate]
    .ReminderPlaySound = False

    .Save
    End With
    End Function

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding a list of tasks (at once) in a form
    By mooseisloose in forum Forms
    Replies: 8
    Last Post: 03-22-2011, 09:27 AM
  2. Outlook tasks export
    By eww in forum Programming
    Replies: 5
    Last Post: 11-12-2010, 03:56 PM
  3. Generating Recurring Tasks.
    By Jamesamorris in forum Access
    Replies: 3
    Last Post: 10-26-2010, 10:46 AM
  4. Outlook to Access
    By Aubreylc in forum Import/Export Data
    Replies: 1
    Last Post: 01-25-2010, 09:37 AM
  5. Reading outlook tasks from Access
    By Bill_dom in forum Import/Export Data
    Replies: 0
    Last Post: 08-07-2008, 06:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums