Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

RE: Outlook Task From Access

Discussion in 'Information Technology' started by Tom Wickerath, Nov 8, 2005.

  1. Tom Wickerath

    Tom Wickerath
    Expand Collapse

    Hi Mark,

    You can use VBA code to build up a string, which you can then use in the
    line of code where you are setting the .body value. Something like this:

    Dim strBodyText as String

    strBodyText = Nz(ContactName + vbCrLf, "") & Nz(Company + vbCrLf, "") _
    & Nz(Products + vbCrLf, "") & Nz(Notes, "")

    followed by:

    With OutlookTask
    .Subject = "This is the subject of my task"
    .Body = strBodyText



    "Mark" wrote:


    I have a client contact database in Access 2003 and I am looking to create
    an Outlook TaskItem as a reminder for myself or assiged to another user.

    I've been able to use the following code (downloaded from the MS website)
    with success however, I would like to populate the '.body' with the details
    of the call. I have several fields setup with ContactName, Company, Products,
    Notes etc and I would like these to form the basis of a detailed reminder
    system for our users

    Here is the code that I have used (tailored slightly for our purposes)...

    Option Compare Database
    Option Explicit

    Function fncAddOutlookTask()
    Dim OutlookApp As Outlook.Application
    Dim OutlookTask As Outlook.TaskItem

    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookTask = OutlookApp.CreateItem(olTaskItem)

    With OutlookTask
    .Subject = "This is the subject of my task"
    .Body = "This is the body of my task."
    .ReminderSet = True
    .ReminderTime = DateAdd("n", 2, Now) 'Remind 2 minutes from now.
    .DueDate = DateAdd("n", 5, Now) 'Due 5 minutes from now.
    .ReminderPlaySound = True
    .ReminderSoundFile = "C:\Windows\Media\Ding.wav" 'Modify path.
    End With
    End Function

    Can someone point me in the right direction as to how to get multiple lines
    to be contained within the task.

    Thanks in advance.
  2. Loading...

Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page