oliv-
Senior Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- Exchange Server
Hi,
I have an issue with vba code when i use .getConversation.GetTable
If we are in mode "Online with Exchange server" or ""Connected to Microsoft Exchange" it's ok
But if we are just "Online" (when it's an Additional Mailbox), it's KO there is no line in the table.
additionnal Mailbox but "download shared folders" is uncheck
If i add an account for this mailbox , it's ok the mode is "Online with Exchange server"
What's the difference between "Online with Exchange server" and "online"
and why this code not get the same result ?
My code
I have an issue with vba code when i use .getConversation.GetTable
If we are in mode "Online with Exchange server" or ""Connected to Microsoft Exchange" it's ok
But if we are just "Online" (when it's an Additional Mailbox), it's KO there is no line in the table.
additionnal Mailbox but "download shared folders" is uncheck
If i add an account for this mailbox , it's ok the mode is "Online with Exchange server"
What's the difference between "Online with Exchange server" and "online"
and why this code not get the same result ?
My code
Code:
Private Sub Test_Conversation()
Dim oMail As Outlook.MailItem
' Obtain the current item for the active inspector.
Set oMail = Application.ActiveInspector.CurrentItem
Debug.Print "Email =" & oMail.subject
Debug.Print "oMail class=" & oMail.Class
MsgBox oMail.subject
Dim oConv As Outlook.Conversation
Dim oTable As Outlook.Table
Dim oRow As Outlook.Row
Dim oItem As Outlook.MailItem
Const PR_STORE_ENTRYID As String = _
"http://schemas.microsoft.com/mapi/proptag/0x0FFB0102"
'On Error Resume Next
Debug.Print "oMail Is Nothing=" & (oMail Is Nothing)
If Not (oMail Is Nothing) Then
' Obtain the Conversation object.
Set oConv = oMail.GetConversation
On Error Resume Next
Debug.Print oConv.ConversationID
On Error GoTo 0
Debug.Print "oConv Is Nothing=" & (oConv Is Nothing)
If Not (oConv Is Nothing) Then
Set RootItems = oConv.GetRootItems
Set oTable = oConv.GetTable
Debug.Print "#1# nb de mail de la conversation=" & vbTab & oTable.GetRowCount
oTable.Columns.add (PR_STORE_ENTRYID)
Debug.Print "#2# nb de mail de la conversation=" & vbTab & oTable.GetRowCount
Do Until oTable.EndOfTable
Set oRow = oTable.GetNextRow
' Use EntryID and StoreID to open the item.
Set oItem = Application.Session.GetItemFromID( _
oRow("EntryID"), _
oRow.BinaryToString(PR_STORE_ENTRYID))
Debug.Print oItem.EntryID & vbTab & oItem.subject & vbTab & oItem.ReceivedTime
Loop
Else
Debug.Print "pas une conversation"
End If
End If
End Sub