D
Donald Fisher
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?
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?