I am trying to take contacts data from out look and Synchronize with our database. I am using .net 1.1 framework.
iam using following code.
OLCont = MyOLList.GetLas t 'CType(item, outlook.Contact Item)
Do While TypeName(OLCont ) <> "Nothing"
OLRow = OLTable.NewRow
OLRow(0) = 0
OLRow(1) = IIf(OLCont.Firs tName Is Nothing, "", OLCont.FirstNam e)
OLRow(2) = IIf(OLCont.Midd leName Is Nothing, "", OLCont.MiddleNa me)
OLRow(3) = IIf(OLCont.Last Name Is Nothing, "", OLCont.LastName )
OLRow(4) = IIf(OLCont.Full Name Is Nothing, "", OLCont.FullName )
OLTable.Rows.Ad d(OLRow)
OLCont = MyOLList.GetPre vious
Loop
problem is when i run this code in windows 2000 systems with outlook 2003 running properly. Its retrieving all contacts records from outlook properly
same code throws "specified cast not valid" error when i run in windows xp (service pack 2 ) with outlook 2003. some contacts records are retrieved but not all.
while parsing through contacts records only we are getting the above error.
please help me in this.
iam using following code.
OLCont = MyOLList.GetLas t 'CType(item, outlook.Contact Item)
Do While TypeName(OLCont ) <> "Nothing"
OLRow = OLTable.NewRow
OLRow(0) = 0
OLRow(1) = IIf(OLCont.Firs tName Is Nothing, "", OLCont.FirstNam e)
OLRow(2) = IIf(OLCont.Midd leName Is Nothing, "", OLCont.MiddleNa me)
OLRow(3) = IIf(OLCont.Last Name Is Nothing, "", OLCont.LastName )
OLRow(4) = IIf(OLCont.Full Name Is Nothing, "", OLCont.FullName )
OLTable.Rows.Ad d(OLRow)
OLCont = MyOLList.GetPre vious
Loop
problem is when i run this code in windows 2000 systems with outlook 2003 running properly. Its retrieving all contacts records from outlook properly
same code throws "specified cast not valid" error when i run in windows xp (service pack 2 ) with outlook 2003. some contacts records are retrieved but not all.
while parsing through contacts records only we are getting the above error.
please help me in this.
Comment