A Microsoft Outlook email forum. Outlook Banter

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   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Help on Code - Create "Normal" Outlook Task from Access



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 26th 09, 02:05 PM posted to microsoft.public.outlook
Sunflower
external usenet poster
 
Posts: 3
Default Help on Code - Create "Normal" Outlook Task from Access

I used code to create an Outlook task from Access...

Creating a task manually in Outlook shows a tick box, date field, etc
but a task
created using this code does not seem to have those controls. The
whole task form looks pretty different so I am guessing there is
something else that needs to be done to show it like a 'normal' task
form.

My code in Access

Public Function AssignTask()
Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.Outlook.TaskRequestItem
Dim myDelegate As Outlook.Recipient
'Information from subform
Dim strReciprient As String, strResponsibleParty As String 'These are
the same person
Dim strProject As String 'ActionDescription
Dim strFacility As String
Dim strFrequency As String
Dim strDueDate As String
Dim frm As Form
Dim sfN As Form 'Program Notification SubForm

Set frm = Forms!frmMainEntry.Form
Set sfN = frm.[fctlNotifications].Form
If sfN.[ProgramID] = sfN.[txtID] Then

strProject = sfN.ProgramDescription
strFacility = sfN.Facility
strDueDate = sfN.DueDate
strFrequency = sfN.FrequencyOfService
strReciprient = sfN.EmailAddress
strResponsibleParty = sfN.ResponsibleParty
strSender = frm!txtWelcome
Else
Exit Function
End If

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)

myItem.Assign
Set myDelegate = myItem.Recipients.Add(strReciprient)
myDelegate.Resolve
If myDelegate.Resolved Then
myItem.Subject = "Notification Of Compliance Requirement"
myItem.Body = vbCrLf & vbCrLf & vbCrLf & _
"To: " & strResponsibleParty & vbCrLf & vbCrLf & vbCrLf & _
"This is to notify you that the requirement for " & strProject & " at
the " & _
strFacility & " is due on " & strDueDate & "." & vbCrLf & _
strProject & " is required " & strFrequency & "." & vbCrLf & vbCrLf &
vbCrLf & _
"Keep On Track With Safety" & vbCrLf & strSender
myItem.DueDate = strDueDate
myItem.ReminderTime = DateAdd("ww", -1, strDueDate) 'Remind 1 Week
before Due Date.
'myItem.Display
myItem.Importance = (olImportanceHigh)
myItem.Send
End If
End Function


Any and all help greatly appreciated
 




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form code to create "new message using stationery" Peter J. Veger Outlook - Using Forms 3 October 19th 07 01:53 AM
Unable to adjust "Notes" from overfilling screen to normal sizes. Everseeker Outlook - General Queries 1 December 17th 06 08:47 PM
"Save Task Order" in code? [email protected] Add-ins for Outlook 1 October 6th 06 05:53 AM
Can not open "task request" "task accepted" in Inbox LaParker Outlook - General Queries 2 August 9th 06 10:09 PM
Where is "Categories" field in create new task window? How do I add it? [email protected] Outlook - Calandaring 1 February 1st 06 07:21 PM


All times are GMT +1. The time now is 02:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.