Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     

Share This Page