Kerry was telling us:
Kerry nous racontait que :
> Hi Jean-Guy
>
> Thank you very much for the info, I have tried it out but
> I am still getigng an error message when distribution
> lists are present - have I entered the code correctly??
From the snippet you have posted, I would say yes.
I have used that before without any problems, so from where I am sitting, I
can't say why it is not working for you.
What lines errors out now? What is the error message (Same as before or
not)?
Have you posted in an Outlook group?
If you do and get an answer, report back!

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Kerry - 23 Nov 2004 16:21 GMT
Hi Jean-Guy
I am still getting the same error as before - data type
mismatch error 13. the error does not appear and all
works well if I remove all distribution lists from my
outlook contacts area
'recipient:
x = 0
Set oApp = CreateObject("Outlook.Application")
Set oNspc = oApp.GetNamespace("MAPI")
For Each oItm In oNspc.GetDefaultFolder
(olFolderContacts).Items
If oItm.Class = 40 Then '40 = contactItem 69 =
DistribListItem
With Me.RecipList
.AddItem (oItm.FullName)
.Column(1, x) = oItm.JobTitle
.Column(2, x) = oItm.CompanyName
.Column(3, x) = oItm.BusinessAddress
.Column(4, x) = oItm.BusinessTelephoneNumber
.Column(5, x) = oItm.BusinessFaxNumber
End With
End If
x = x + 1
Next oItm
I have posted this in the Outlook area too (Word
connectivity). I received a different answer, but still
the same error when distribution lists are present.
I am puzzled-have u any other ideas please?? Thank you
very much
Kerry.
>-----Original Message-----
>Kerry was telling us:
[quoted text clipped - 14 lines]
>Have you posted in an Outlook group?
>If you do and get an answer, report back!
Kerry - 23 Nov 2004 16:38 GMT
Hi Jean-Guy
The answer to my Word Connection question posted in the
Outlook Newsgroup works wonderfully - I had missed the
changed variable declaration - dim OItm as Object not
ContactItem
Thanks very much
Kerry
>-----Original Message-----
>Hi Jean-Guy
[quoted text clipped - 56 lines]
>>If you do and get an answer, report back!
>.
Jean-Guy Marcil - 23 Nov 2004 17:33 GMT
Kerry was telling us:
Kerry nous racontait que :
> Hi Jean-Guy
>
> The answer to my Word Connection question posted in the
> Outlook Newsgroup works wonderfully - I had missed the
> changed variable declaration - dim OItm as Object not
> ContactItem
Ha, right!
That's what I had done as well... overlooked that small important detail in
my previous post!
Sorry about that!
I think it is a bug of some sort because, according to Outlook VBA help, the
Class property applies to a ContactItem object, but for the code to work,
you have to declare it as a generic object.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org