D
Dhananjay
Hi All,
I am developing one VSTO COM addin for outlook 2003 in vb 2005. My
code snippet is as follows. odbcrdr(0) always contains valid entryID.
'-------------------------------------------------------------------------------------------------------------------------------------------------------
' Set connection & command -----
' ----
Dim odbcrdr As OdbcDataReader
odbcrdr = myCmd.ExecuteReader
Dim cnt As Integer = 0
Dim c As Outlook.ContactItem
Dim ns As Outlook.NameSpace
ns = myGlobalApplication.GetNamespace("MAPI")
While odbcrdr.Read
Try
c = Nothing
c = ns.GetItemFromID(odbcrdr(0))
Catch ex As System.Exception
AddTrace("Contact item can not be set for
entryid - " & odbcrdr(0) & vbCrLf & "Exception - " & ex.Message)
MsgBox("Contact item can not be set for entryid
- " & odbcrdr(0) & vbCrLf & "Exception - " & ex.Message,
MsgBoxStyle.Critical Or MsgBoxStyle.SystemModal)
Finally
c = Nothing
End Try
End While
'-------------------------------------------------------------------------------------------------------------------------------------------------------
Now when the count of returned records is greater than 250, I am
always getting error on record 251 -
Exception - Unable to cast COM object of type 'System.__ComObject' to
interface type 'Microsoft.Office.Interop.Outlook.ContactItem'. This
operation failed because the QueryInterface call on the COM component
for the interface with IID '{00063021-0000-0000-C000-000000000046}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
This error is always appearing on the record 251! One thing is that,
all these records are on my public folder. (If those entryids are from
personal folder then code is working fine!!)
Please Help!
Thanks,
Dhananjay
I am developing one VSTO COM addin for outlook 2003 in vb 2005. My
code snippet is as follows. odbcrdr(0) always contains valid entryID.
'-------------------------------------------------------------------------------------------------------------------------------------------------------
' Set connection & command -----
' ----
Dim odbcrdr As OdbcDataReader
odbcrdr = myCmd.ExecuteReader
Dim cnt As Integer = 0
Dim c As Outlook.ContactItem
Dim ns As Outlook.NameSpace
ns = myGlobalApplication.GetNamespace("MAPI")
While odbcrdr.Read
Try
c = Nothing
c = ns.GetItemFromID(odbcrdr(0))
Catch ex As System.Exception
AddTrace("Contact item can not be set for
entryid - " & odbcrdr(0) & vbCrLf & "Exception - " & ex.Message)
MsgBox("Contact item can not be set for entryid
- " & odbcrdr(0) & vbCrLf & "Exception - " & ex.Message,
MsgBoxStyle.Critical Or MsgBoxStyle.SystemModal)
Finally
c = Nothing
End Try
End While
'-------------------------------------------------------------------------------------------------------------------------------------------------------
Now when the count of returned records is greater than 250, I am
always getting error on record 251 -
Exception - Unable to cast COM object of type 'System.__ComObject' to
interface type 'Microsoft.Office.Interop.Outlook.ContactItem'. This
operation failed because the QueryInterface call on the COM component
for the interface with IID '{00063021-0000-0000-C000-000000000046}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
This error is always appearing on the record 251! One thing is that,
all these records are on my public folder. (If those entryids are from
personal folder then code is working fine!!)
Please Help!
Thanks,
Dhananjay