in Technology

Mac Office X weirdness with MHT files

We are using Multipart MIME based MHT files (aka WebArchive aka Mail HTML) to create reports that can be viewed/printed/edited in Word. This is the easiest way of generating reports from a web application as standard HTML/CSS can be used. The packaging format is like an email with attachments. Everything into a single .mht file – main document, images, header/footer and finally a filelist.xml file which ties things together. You can also rename the .mht file to .doc and the users would not even realize it was generated using HTML.

I am facing some weird problems with this format on the Mac version of MS Office. The document works perfectly on Windows. When you take the file to Mac and open it in Office X, it shows everything but the images.

Weird also because even if you create a new document on the Mac itself, save it as MHT and then open again, the images disappear. Yet, they are there in the MHT file if you open the file using a text editor.

This is ofcourse driving me crazy as I write this 🙁

One hack that seemed to work was to refer to the images in the document without the folder name. E.g. For Office for Windows:
[html][/html]
But for Office X:
[html][/html]

This too is working in some cases and not in some. I am trying to find a pattern on it right now, and will post a comment once I nail it down!




Write a Comment

Comment

  1. I know this is an old post, but I’ve had the exact same trouble the couple of days. This is how I solved it:

    Change all Content-Location to use http://localhost/nameoffile.png
    ..and use that in the mht (e.g. )
    You can use any URL there. On Windows, file:/// works but not on Mac for some reason.

    Works on Office:mac 2011.

    Hopefully it helps the next googler coming here!