I have a requirement in which I have to make a exportable word document from a contract record. I have decided to create a visualforce page with contentType set to application/msword.
I understand that Salesforce offers this as a workaround but there is no official documentation or support (only a help.salesforce page) and they explicitely say that the necessary css/html code needed to visualize a word in a certain way is out of scope for Salesforce support, so I come here to see if anyone knows.
The documents I'm generating are in Spanish, and there are a lot of special characters (ñ, for example, and acute letters)
When I first exported the document, with the text in my html with the special characters added directly, the word shows, for example, the "ñ" character as "ñ", the "á" as "á", etc etc.
I thought that using the HTML codes for those characters would the trick "& aacute;", etc etc. But it doesnt. Is there any other way to represent those special characters so the Word engine understands them? Do I have to explicitely define the encoding or something? Any help would be appreciated!
(I tried with the entity name, entity number and HEX code, and nothing works. Do I have to involve CSS into this?)
contentType="application/msword; charset=utf-8"
and see if that helps? It sounds like the encoding or the default encoding is limited to ASCII and specifying the character set should help.