XML tags disappear from email body when moved to local folder

0

0

I use Outlook 2013 on Windows 7 (both updated to latest patches), in "online" mode (the setting "Use Cached Exchange Mode" is disabled, normally it is enabled by default).

If I receive an email (HTML format, on an Exchange server) that contains XML tags, for example:

the customers age is in the <age> element

then that works fine, but if I move the email message to a local data folder and open it from there, the text looks like:

the customers age is in the element

The XML tags disappear.

I drilled down to the fact that while in the original message the source code is correct, like:

the customers age is in the &lt;age&gt; element

After moving it becomes:

the customers age is in the <age> element

Where the "unknown" tag is ignored by the renderer.

Any idea why this happens and how to fix it?

I excluded the antivirus SW from the list of suspects (by uninstalling and cleaning it and then repeating the test).

If I change the account settings by enabling "Use Cached Exchange Mode", then the problem is gone (except older messages in the local data folder that were broken, they stay broken). Is this a known issue wit cached mode?

David Balažic

Posted 2018-07-23T13:35:24.513

Reputation: 1 242

Does it happen on another computer if we forward the email to another user? If it only happen on this specific computer, we may try to recreate the OST file since it only happens when cached Exchange mode is on. It could be that the current OST file is corrupted. – Steve Fan – 2018-07-25T06:57:09.497

@SteveFan I tried on a coworkers PC and there it does not happen, but he uses cached mode. (I had a typo in the question, was "disabling cache mode", now fixed to "enabling cached mode) – David Balažic – 2018-07-25T08:56:29.380

How do you move the message to local data folder? – harrymc – 2018-07-26T19:54:40.173

@harrymc I move by drag'n'drop, with the mouse. – David Balažic – 2018-07-27T11:11:53.893

What happens if instead you use File / Save As ? – harrymc – 2018-07-27T11:25:28.150

@harrymc It is the same. In online mode the tags get broken, in cached mode they stay OK. What I did was File/Save As, and then open the saved file with doubleclick (it is opened by Outlook). Or I drag them into the data folder in Outlook and open it there. In both cases the tags are broken. – David Balažic – 2018-07-30T09:39:33.547

I think that the only conclusion is that this is by design. It seems to me that by this same screwed design, true export is only possible for localy-resident messages. Either use cached mode or perhaps instead Export or backup to an Outlook .pst file.

– harrymc – 2018-07-30T09:52:59.050

@harrymc Exporting in online mode also corrupts the data the same way. – David Balažic – 2018-07-30T17:13:31.857

Conclusion is that you are up against a general bug (or stupidity). Cached mode offers a workaround, maybe unintended by Microsoft. It's possible that a VBA script could do better : As a last-ditch effort, you could test the VBA example in the Microsoft article of MailItem.SaveAs Method (Outlook). If new to VBA, see How to use Outlook's VBA Editor.

– harrymc – 2018-07-30T17:53:24.790

Does this also happen when Outlook is ran in safe mode? Could you please try? – Aulis Ronkainen – 2018-07-31T06:00:26.730

@AulisRonkainen Yes, it does. I tried. – David Balažic – 2018-07-31T08:31:13.357

Answers

0

When Cached Exchange Mode is disabled, the message exported by Outlook 2013 have their XML instantiated. Specifically, the XML entity of &lt; is replaced by < and &gt; by >. The result is then not an exact copy of the message.

This happens both when using drag-and-drop to the file-system or the menu File / Save As. I had suggested also trying VBA, using the VBA example in the Microsoft article of MailItem.SaveAs Method (Outlook) (see How to use Outlook's VBA Editor), but I don't believe that this will change the result.

My conclusion is that this is a general bug (or bad implementation) in Exchange. Cached mode offers a workaround, maybe unintended by Microsoft, where the message is written to the file-system from the local cache as-is. However, when requesting the message from the Exchange server, the XML instantiation is always done, and probably on the server side as all the export mechanisms give the same result. The locally-installed version of Outlook does not do the XML instantiation that is done by the Exchange server.

So, unfortunately, the empirical conclusion is that "Cached Exchange Mode" must be enabled for avoiding XML instantiation, at least for the present.

harrymc

Posted 2018-07-23T13:35:24.513

Reputation: 306 093