Windows Mail: Modifying .Body causes trouble

Add-in Express™ Support Service
That's what is more important than anything else

Windows Mail: Modifying .Body causes trouble
Modifying the Body property of ADXOEItem switches to "unicode" 
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
Hello,

We have just purchased ADX for Outlook Express and Windows Mail.

We would like to insert an image into the currently open mailmessage by the click of a button.

First, We've tried inserting the following string into the .HTMLBody property (after the <BODY> tag) of Application.ActiveInspector.CurrentItem.HTMLBody:

<IMG src="C:\image.jpg">

This however results in <IMG src=""> and an red-cross error image within the Source-view of Windows Mail. It seems Windows Mail strips the path on insertion..? How to fix this..?

Secondly we tried to modify the .Body property instead, and for starters just adding "Hi" to the current Body. This code:

Private Sub cmdInsert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdInsert.Click
        Application.ActiveInspector.CurrentItem.Body += "Hej"
End Sub

- first off results in the expected, but by clicking the Source-tab reveals some odd-looking HTML. And when switching back to Editing, the Caption of the Inspector window changes from "<Subject>" to "<Subject> - unicode". Switching back and forth between Editing and Source increasingly adds weird characters to the mail.

I hope you can understand my explanation, reproduce this and help me out.

Thanks in advance,
Jacob S. V.
Posted 25 Sep, 2008 07:01:40 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Jacob,

I have reproduced the issue. Thank you for pointing me to this.
.NET, Extended MAPI, Windows Phone & RT
Posted 25 Sep, 2008 12:19:40 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Jacob,

I have set the Encoding according to my regional and language settings and the following code works fine for me:

AddinExpress.OE.ADXOEInspector insp = Application.ActiveInspector;
AddinExpress.OE.ADXOEItem mail = insp.CurrentItem;
mail.HTMLBody = @"<img src=D:	est.jpg>";


Please try to set the appropriate encoding for you in Windows Mail / Outlook Express.
Do you get the same results?

What OS do you use?
.NET, Extended MAPI, Windows Phone & RT
Posted 26 Sep, 2008 04:06:09 Top
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
Hello Eugene,

I use Windows Vista Business (Danish). My encoding is set to Western European (ISO) in Windows Mail.

I have tried the following:

Dim insp As AddinExpress.OE.ADXOEInspector = Application.ActiveInspector
Dim mail As AddinExpress.OE.ADXOEItem = insp.CurrentItem
mail.HTMLBody = "&lt;img src=C:test.jpg&gt;"


The last line simply results in a line of text in the mail, reading <img src=C:test.jpg>, which is neat, but doesn't insert an image.
I figured it may have been your post getting fouled up and also tried:

mail.HTMLBody = "<img src=C:test.jpg>"

But with same result as the first post: Windows mail strips out the path.

Am I missing something?
-Jacob
Posted 26 Sep, 2008 04:36:26 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Jacob,

No. Thank you. This is a bug. I will let you know as soon as I get any news from developers.
.NET, Extended MAPI, Windows Phone & RT
Posted 26 Sep, 2008 08:43:25 Top
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
Hello, okay, I really hope you work it out.

-Jacob
Posted 26 Sep, 2008 14:04:48 Top
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
Hi Eugene,

Do you have any idea of the time horizon on this? We really can't continue developing until we find a resolution to this.

I don't need the exact minute, but are we talking a couple of days, a week, a month? Just roughly..
Posted 29 Sep, 2008 15:35:10 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jacob,

It may take a month or so.
.NET, Extended MAPI, Windows Phone & RT
Posted 30 Sep, 2008 08:22:44 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jacob,

Unfortunately, our research shows that this is an internal limitation of Windows Mail which is beyond our control, so it is not possible to insert an image when running on Vista.

.NET, Extended MAPI, Windows Phone & RT
Posted 08 Oct, 2008 06:41:14 Top
Jacob Vestergaard




Posts: 68
Joined: 2008-06-08
Hi Eugene, thanks for your research.

I see what you mean; there is a security setting in Windows mail called "Block images and other external content in HTML e-mail". When this is ON the path gets stripped out, and when OFF the path is allowed and it works.

How about the second part of my first post in this thread, concerning modifying the .Body property, which results in switch to unicode?
Posted 08 Oct, 2008 09:03:28 Top