Import Outlook Task Form Data Into Access
- From: Donald Fisher <dsfcom@xxxxxxx>
- Date: Tue, 14 Aug 2007 06:14:02 -0400
I have several public task folders from which I would like to import the task information into Access including some form data. I've tried the table linking deal but it doesn't include the start date and other form data. I know the EntryIDs and StoreIDs but can't figure out how to make it import. Any ideas? Here's my current code:
' Set up DAO objects (uses existing "tblTasks" table)
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("tblTasks")
' Set up Outlook objects.
Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim cf As Outlook.MAPIFolder
Dim c As Outlook.TaskItem
Dim objItems As Outlook.Items
Dim Prop As Outlook.UserProperty
Dim txtEntryID, txtStoreID
txtEntryID = Screen.ActiveForm.ENTRYID
txtStoreID = Screen.ActiveForm.STOREID
Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetFolderFromID(txtEntryID, txtStoreID)
Set objItems = cf.Items
iNumTasks = objItems.Count
If iNumTasks <> 0 Then
For i = 1 To iNumTasks
If TypeName(objItems(i)) = "TaskItem" Then
Set c = objItems(i)
rst.AddNew
rst!TASK = c.Subject
rst!DueDate = c.DueDate
rst!STARTDATE = c.STARTDATE
rst!Status = c.Status
rst!Rec = c.IsRecurring
rst!SECTION = Screen.ActiveForm.DutySection
rst!Remarks = c.Body
rst.Update
End If
Next i
rst.Close
End If
After the last rst! I would like to add a reference to a field on a custom tab: (There's the 'TASK' tab and 'MY TAB')
rst!EQUIPID = c.MyCustomTab.EQUIPID (or whatever will work)
Any ideas?
.
- Follow-Ups:
- Re: Import Outlook Task Form Data Into Access
- From: Mark J. McGinty
- Re: Import Outlook Task Form Data Into Access
- From: Brian Tillman
- Re: Import Outlook Task Form Data Into Access
- Prev by Date: Re: Not All Outlook 2003 Email Attachments Go Out
- Next by Date: Re: Outlook 2003 does not "remember' previous email addresses when you type in their first name - only for the last name
- Previous by thread: Re: Not All Outlook 2003 Email Attachments Go Out
- Next by thread: Re: Import Outlook Task Form Data Into Access
- Index(es):
Relevant Pages
|
Loading