Hope this scenario will be very interesting for everyone!! I have a scenario where the user needs to download the word document by clicking a link on page.
This word document is dynamically generated from visualforce by fetching values from the record.
Everything works fine. But the problem is when I try to open the downloaded document in MsWord (2007 or 2010), It opens in web layout by default. But I need to open the document in print layout / print view.
I searched and found that the below code snippet works well for all kinds of technology like php, python, etc..
// Code snippet <!--[if gte mso 9]> <xml> <w:WordDocument> <w:view w:val="print" /> <w:zoom w:percent="100" /> <w:DoNotOptimizeForBrowser/> <w:DoNotHyphenateCaps/> <w:PunctuationKerning/> </w:WordDocument> </xml> <![endif]-->
But it didnt work with visualforce. I placed this code snippet inside the tag and right below the tag as per Office XML reference. But I didnt get a positive result.
Is there anyway to achieve this in visualforce??