J
Job
Here is what I've started with
Set ol = New Outlook.Application
Set olNs = ol.GetNamespace("MAPI")
Set myRecipient = olNs.CreateRecipient("PMO")
myRecipient.Resolve
If myRecipient.Resolved Then
Set Fldr = olNs.GetSharedDefaultFolder _
(myRecipient, olFolderTasks)
End If
For i = 1 To Fldr.Items.Count
'For Each fld In Fldr.Items(i).Subject
' Debug.Print "Field Name : " & fld.Name
' Debug.Print "Field Value : " & fld.Value & vbCrLf
'Next
Debug.Print Fldr.Items(i).Subject
For Each fld In Fldr.Items(i).UserProperties
Debug.Print "Field Name : " & fld.Name
Debug.Print "Field Value : " & fld.Value & vbCrLf
Next
Next i
End Sub
This gives me the subject of each task and the custom fields for each task
in a users shared task folder.
What I'm trying to do is iterate through each of the fields in the task so
that I don't have to specify each field. for example;
I don't want to do this
Fldr.Items(i).Subject
Fldr.Items(i).Duedate
Fldr.Items(i).Body
etc.
Anyone know the code to pull the field name and associated value for every
field of the task?
Cheers
Set ol = New Outlook.Application
Set olNs = ol.GetNamespace("MAPI")
Set myRecipient = olNs.CreateRecipient("PMO")
myRecipient.Resolve
If myRecipient.Resolved Then
Set Fldr = olNs.GetSharedDefaultFolder _
(myRecipient, olFolderTasks)
End If
For i = 1 To Fldr.Items.Count
'For Each fld In Fldr.Items(i).Subject
' Debug.Print "Field Name : " & fld.Name
' Debug.Print "Field Value : " & fld.Value & vbCrLf
'Next
Debug.Print Fldr.Items(i).Subject
For Each fld In Fldr.Items(i).UserProperties
Debug.Print "Field Name : " & fld.Name
Debug.Print "Field Value : " & fld.Value & vbCrLf
Next
Next i
End Sub
This gives me the subject of each task and the custom fields for each task
in a users shared task folder.
What I'm trying to do is iterate through each of the fields in the task so
that I don't have to specify each field. for example;
I don't want to do this
Fldr.Items(i).Subject
Fldr.Items(i).Duedate
Fldr.Items(i).Body
etc.
Anyone know the code to pull the field name and associated value for every
field of the task?
Cheers