MojoDK
MojoDK

Reputation: 4528

Outlook Addin and casting problems

Using VS2015 and Outlook 2016...

In my outlook addin, if I do this...

Dim item As Outlook.MailItem = DirectCast(selectedItem, Outlook.MailItem)

Then in the debug watch, it casts item as "system.__comobject" and I can't see properties right.

Same goes with attachements, eventhough I cast them as directcast(myMailItem.Attachment(0), Outlook.Attachment) then it's still a "system.__comobject".

Any idea how to cast them right?

Update: Screenshot...

enter image description here

Upvotes: 0

Views: 50

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49397

Try to use CType cast operator instead. Do you get the same results?

I can see all properties of the MailItem instance in the debug watch window.

UPD: I see that you don't use the mailItem object in the window. Try to expand its properties instead.

Upvotes: 0

Related Questions