I think the issue was by ths following , You are modifying and saving different objects - every time you call oItems.Item(i), you get back a brand new COM object that is not guaranteed to know anything about the other instances of that object. Sometimes Outlook caches the last used object, sometimes it does not. Store the item in a dedicated variable. On a more general note, multiple dot notation (like oItem.Item(1)) is always a bad idea.
Dim oItem As Object
oItems.IncludeRecurrences = False
set oItem = oItems(1)
oItem.Subject = "foo"
fixed the issue. Will look into that further you can do that by using SetState and SetStateDynamicEntity messages. Based on messages InputParameter will change accordingly. in that way you have to trigger the plugin. Here the code below for your reference.
if (context.InputParameters.Contains("EntityMoniker") &&
context.InputParameters["EntityMoniker"] is EntityReference)
EntityReference myEntity = (EntityReference)context.InputParameters["EntityMoniker"];
C# Outlook Addin - Show Outlook.mailitem in the outlook preview pane?
wish helps you div padding is ignored in outlook. Your best bet is to insert a table inside the div and then pad the TDs inside of it. There were some other errors in your code, that i made changes to in the below, but this works in Outlook. I would also recommend using padding-top, etc instead of just padding because i have found it is more widely accepted and consistent across email clients.
I hope this helps . Don't use GetActiveObject with Outlook - it is a singleton, so creating a new instance of the Outlook.Application object will return a pointer to the existing instance if it is already running.
How to show vertical pane in Outlook add-ins in Outlook Web App (OWA), Outlook 2016 Mac & Windows