![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Receiving message in Outlook when call interop from vb.net and trying to
read/load emails from inbox to windows form into datagridview. Message is: The add-in "c\program files\postx\trusted messaging client for outlook\..." could not be installed or loaded. This message occurs at different times, never on the same email. Usually after it loads over 150 emails. We think it is related to COM performance, thus put in System.Threading.Thread.Sleep(100), this seems to work, but slow to load emails. Any input would be helpful. Here is the basic code. Dim oAppm As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application Dim oInboxm As Microsoft.Office.Interop.Outlook.MAPIFolder Dim oItemsm As Microsoft.Office.Interop.Outlook.Items Dim oNSm As Microsoft.Office.Interop.Outlook.NameSpace = oAppm.GetNamespace("MAPI") oInboxm = oNSm.GetDefaultFolder(Microsoft.Office.Interop.Out look.OlDefaultFolders.olFolderInbox) oItemsm = oInboxm.Items For i As Integer = oItemsm.Count To 1 Step -1 'Test to make sure item is a mail item and not a meeting request. sClassComp = oItemsm.Item(i).messageclass Select Case sClassComp Case "IPM.Note", "IPM.Note.Rules.ReplyTemplate.Microsoft", "IPM.Note.Secure" Me.DataGridView1.Rows.Add() Dim oMsgm As Microsoft.Office.Interop.Outlook.MailItem oMsgm = TryCast(oItemsm.Item(i), Microsoft.Office.Interop.Outlook.MailItem) iCellCounter = 0 Me.DataGridView1.Rows(iRowCounter).Cells(iCellCoun ter).Value = oMsgm.SenderName Me.DataGridView1.Rows(iRowCounter).Cells(iCellCoun ter + 1).Value = oMsgm.Subject Me.DataGridView1.Rows(iRowCounter).Cells(iCellCoun ter + 2).Value = oMsgm.ReceivedTime Me.DataGridView1.Rows(iRowCounter).Cells(iCellCoun ter + 3).Value = oMsgm.ConversationIndex Pause() iRowCounter += 1 Case Else End Select Next i |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
search remote calendars with Microsoft.Office.Interop.Outlook 11 | entvex | Outlook - General Queries | 1 | January 28th 09 03:03 PM |
Hot to get propetyInfo of Microsoft.Office.Interop.Outlook.MailIte | Jongmin | Outlook - Using Forms | 1 | October 16th 08 03:47 PM |
Unable to cast object of type 'System.__ComObject' to type 'Microsoft.Office.Interop.Outlook.ApplicationClass' | John Yovas | Add-ins for Outlook | 2 | September 12th 08 05:23 PM |
How to get Microsoft.Office.Interop.Outlook.TaskItem from the IUnknown (C#) | Godandag | Add-ins for Outlook | 5 | April 5th 07 10:39 AM |
Msdn help for Microsoft.Office.Interop.Outlook members | DavidE | Add-ins for Outlook | 0 | August 9th 06 08:45 AM |