How to display word document in the browser

Hello all, Did someone find a way to view a word file in the browser? I tried ‘Document viewer’ but it doesn’t display the file, it just proposes to save it. I also try to use the google document viewer in an IFrame but it isn’t able to open the url I get from my FileDocument… any new ideas??? Thanks in advance
5 answers

You can try to create a Published REST service (GET method) that delivers the document like this:


Beware of the authentication for your documents, use secure tokens like in this example


Hey Vincent,

Im facing the same challenge: I want to preview a .docx file in Mendix. Can't find a solution.

What the status on this?

UPDATE: I've used the method of Pim to solve this matter.

  1. Create a REST service that returns the FileDocument. 
  2. On the page where you want to view the .docx, insert an iframe component with the url to MS Office Viewer: 
  3. As the src url, use the url to your new webservice. The end result is something like: 
  4. The iframe will show the MS Office Viewer and use your webservice to fill the source. The .docx file is displayed within a Mendix page.

Some considerations: 
- Security. Documents are public. Also, to me it looks like MS Office Viewer stores a temporary copy of your document to get this working. This is a risk.
- Does not work with localhost. MS Office Viewer requires a valid domain and hosting.
- You might have to encode the src url so it can handle spaces and other symbols in filename.




The shortcut, although not very dynamic: Save your word document as html and copy-paste this into a Mendix html-widget. See what happens and take it from there.


still not working… any idea?

To give you more information, my application is a viewer of technical sheets stored in Teamcenter.

So there is a part which get the path of each file in Teamcenter file systems and store it in Mendix.

The other part should allow the user to view in the browser the selected Technical Sheet…

There are more than 10000 sheets in Teamcenter and the format can be doc, docx or pdf…

And I have to make it as easy as possible because it will be used in the factory and technician should click as little as possible...

So I need a way to display these file in my application.

thanks in advance



Hello all,

I did not found any solution. I don’t understand because the in the documentation of the document viewer there is this sentence:

1.2 Limitations

The widget tries to display a document inside a page. However, it may fail to do this, since browser settings determine whether a document can be opened inside a page. In such cases, a download pop-up window is opened. For example, Internet Explorer may succeed in opening a .doc file inside a page and fail in opening a .png image, while exactly the opposite may be true for FireFox.

I have tried in IE but still get the download popup that occurs instead of viewing my file...
I really need help with this!

thank you in advance