Closed vitaliJJ-source closed 3 years ago
I'm using Outlook 2016 and don't get this error. I'm guessing you have a different version. Could you run a quick test for me?
Add a break into the code on the Set theConversation...
line by clicking on the left side of the line (red arrow). Then, run the macro on an email. When the macro pauses at the breakpoint, activate the locals window if it isn't already shown (in VBA toolbar, View -> Locals Window). I'd like to know what the properties of selectedItem
are, specifically any properties related to the conversation (such as those marked by the red box). Thanks and I'm glad you (were) finding the macro useful.
Hi Kyle, thank you for your quick reply. It looks very similar to your picture: I don't know if theConverstation is OK:
Hi Kyle, it took me a while. I found a workaround, I used an example from MSDN: https://docs.microsoft.com/de-de/office/vba/api/outlook.conversation.getalwaysmovetofolder. And just stick to their variable names. In my opinion it seems to be that theConversation is kind of reserved. It is working now.
This is the section, I had also to replace a few "oConv" below.
`Public Sub GetConverstationInformation()
Dim oMail As Outlook.MailItem
Dim oConv As Outlook.Conversation
Dim oStore As Outlook.Store
' Get Item displayed in Reading Pane.
Set oMail = ActiveExplorer.Selection(1) '
Set oStore = oMail.Parent.Store '
If oStore.IsConversationEnabled Then '
Set oConv = oMail.GetConversation '
Debug.Print ("Selected item: " & oMail.ConversationTopic) '
If Not IsNull(oConv) Then`
Great find! When I get the time I'll test myself, but I did notice theConversation
was of type SolutionsModule
for you whereas for me it was Conversation
, which matches the dim
statement above it. Thanks for your research, I'll see if I can make updates to fix the macro for everyone.
Hi Kyle,
I was using your great tool since a while, however since yesterday I run an update on Outlook, now it stuck here -> in second line:
The message by debugger: "Run Time error 13, type mismatch." I am not sure what is going on here.
I would appreciate If you could look into this.
Best regards, JJ