Outlook reminders in access 2003

Diggs72

New Member
Joined
Jan 24, 2006
Messages
15
Hi,

I am currently working on an access database (2003 format) and need to have access set a reminder based on a date from a database record. This would be in an exchange environment.

I was thinking that if I set the update property on the form to auto create an outlook task with a reminder or better an appointment in a shared calendar with reminders (is this possible?). I found this code snipplet but I keep getting an undefined sub error.

Any help?

Code:
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
        'Remind 2 minutes from now.
        .ReminderTime = DateAdd("n", 2, Now)
        'Due 5 minutes from now.
        .DueDate = DateAdd("n", 5, Now)
        .ReminderPlaySound = True
        'Modify path.
        .ReminderSoundFile = "C:\WINNT\Media\Ding.wav"
        .Save
    End With
End Function

I did reference to outlook 11.0 objects under tools/reference.

What I am really curious about is in the case of a shared database - how do you handle which outlook is used to generate the objects (tasks, reminders, email)?? In this situation I have say 5 users using identical machines with identical software and nobody knows who will be accessing the form at any given time, yet I want to reminders to go to a "coordinator" is this possible?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Diggs72

New Member
Joined
Jan 24, 2006
Messages
15
OK so I have it working now (not sure what changed, but it is working) for the outlook property ".Subject" I would like to use the name of the project, however this name resides in a diferent table and is represented as an ID number in the project table.

Is there a way to specify this value instead of the ID number without breaking normalization?

Anybody?
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi

You can pull the name from another table if you have the stored ProjectID either somewhere within your code or on the form that uses this code.

Assuming the project code is somewhere on the form (I'm assuming this code is attached to a button on a form?) then you can pull the project name as follows :

Dim str MyProject As String

MyProject = DLookup("[ProjectName]", "ProjectTable", "[ProjectID] = " & Me.ProjectLinkID)

Then change your .Subject line to something like :

.Subject = "Subject / Let's discuss etc : " & MyProject

This assumes the project id is a numerical field - if not, let me know. Make sure you use your actual field and table names where I have used 'ProjectName', 'ProjectID' and 'ProjectTable' and use your actual control name from the form where I have used 'ProjectLinkID'.

HTH, Andrew
 

Diggs72

New Member
Joined
Jan 24, 2006
Messages
15
Thanks Andrew,

This is exactly what I was looking for!

Btw, is it possible to direct the outlook integration to a particular object?

E.g. I have two task lists, one private and one public. I would like this code segment to interact with the public task list only.

Is this possible?

Thanks again,

Diggs
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi Diggs

In a word I'm not sure. I haven't tried that before but it looks like it's a question of default folders and the way you create the new instance of Outlook in your code. I don't the answer but you may get some hints from here or here at MS - in the second link, search for 'olPublicFoldersAllPublicFolders' and that may be what you need to reference.

HTH, Andrew
 

Forum statistics

Threads
1,136,594
Messages
5,676,700
Members
419,644
Latest member
KeelsM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top