I am using custom button in standard view page for generating word document. When i click on button, a new window is opening and document generated in that window. I don't want new window. How can i download the document in same window.
-
share the button script here– apKashCommented Mar 2, 2016 at 10:51
-
I am assinging VF page for the button. If i change behavior "Display in existing window" standard view page redirecting to VF word document page and document downloaded. But i want stay standard page only.– Vijay KumarCommented Mar 2, 2016 at 11:17
-
@Ratan, some what it's working. onclick will not opening new window but it's opening new tab.– Vijay KumarCommented Mar 2, 2016 at 11:32
Add a comment
|
1 Answer
Given an Extension to your Visual force page with the below code:
contentType="application/msWord#yourFile.doc"
So, your word will be downloaded without displaying a new window.
Hope it helps you.
-
-
Strange. Any errors? Have you checked any wrong typos in contentType?– Rv1Commented Mar 2, 2016 at 11:43
-
No errors, it's redirecting standard page to vf page in same tab. but i want to stay in standard view page. My tag is like contentType="application/msWord#HR_WordDocument.doc" Commented Mar 2, 2016 at 11:54
-
I hope you're developing the VF page in respective instance only. In that case, it will redirected and remain in same VF page. Please disable the Development Mode and test the button. You will get your expected behavior.– Rv1Commented Mar 2, 2016 at 11:59
-