G
Guest
Hi, I'm updating public folder contacts from MS Access. When I have a
reference to the Outlook Object Library the routine does its thing. However
I'm using Outlook 12 and the other users have Outlook 11. So I want to remove
the reference to the Outlook Object Library and declare variables as
[generic] objects instead of outlook.objects. Unfortunitely it now fails...
The following is the code snippet (contained within a loop of a recordset)
with the problem. Background is I have a table that maps outlook contact
fields to database fields. The code retreives (strOlField) the appropriate
outlook contact field for data insertion.
'Insert an outlook for each database contact
Set myContact = myContactItems.Add(olContactItem)
For Each fld In .Fields
If Not IsNull(fld.Value) Then
strOlField = getOutlookField(fld.Name, strColumn)
If Len(strOlField) > 0 Then
myContact.ItemProperties(strOlField) = fld.Value
End If
End If
DoEvents
Next fld
The line
myContact.ItemProperties(strOlField) = fld.Value
generates "Error 450 (Wrong number of arguments or invalid property
assignment)..."
This error does not occur when using early binding.
Any ideas or suggestion appreciated
Many thanks, Jonathan
reference to the Outlook Object Library the routine does its thing. However
I'm using Outlook 12 and the other users have Outlook 11. So I want to remove
the reference to the Outlook Object Library and declare variables as
[generic] objects instead of outlook.objects. Unfortunitely it now fails...
The following is the code snippet (contained within a loop of a recordset)
with the problem. Background is I have a table that maps outlook contact
fields to database fields. The code retreives (strOlField) the appropriate
outlook contact field for data insertion.
'Insert an outlook for each database contact
Set myContact = myContactItems.Add(olContactItem)
For Each fld In .Fields
If Not IsNull(fld.Value) Then
strOlField = getOutlookField(fld.Name, strColumn)
If Len(strOlField) > 0 Then
myContact.ItemProperties(strOlField) = fld.Value
End If
End If
DoEvents
Next fld
The line
myContact.ItemProperties(strOlField) = fld.Value
generates "Error 450 (Wrong number of arguments or invalid property
assignment)..."
This error does not occur when using early binding.
Any ideas or suggestion appreciated
Many thanks, Jonathan