If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Creating Outlook Task from Access 2007

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-23-12, 06:21
Trunner32 Trunner32 is offline
Registered User
 
Join Date: Jan 2012
Posts: 1
Creating Outlook Task from Access 2007 (Code Included)

I have a database for tracking action items. I have been asked to add a feature that will create an Outlook task after entering an Action Item. The plan is to have a button that you would push that would bring up the task with most of the data filled in. You could edit the task, then send it out.

I have looked as similar previous posts, but everytime I try to code it, I get and error. Any suggestions on how to get this accomplished?


Using the code below, I get "Compile Error: User-defined type not defined" on the line: Dim OutlookApp As Outlook.Application


___________ Code Below ________

Private Sub Command63_Click()

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

With OutlookTask
.Subject = "You have been assigned a task"
.Body = "need to reference Action Item Database Here"
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Date)
.DueDate = DateAdd("n", 5, Date)
.Categories = "Need to identify category"
.ContactNames = "If possible leave open so user can fill in who is assigned, or pull from database"

.Save

End With

Set OutlookApp = Nothing
Set OutlookTask = Nothing


End Sub

________________________


Regards,
Trunner32

Last edited by Trunner32; 01-24-12 at 03:40.
Reply With Quote
Reply

Tags
access 2007, access form

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On