Milind Anantwar
Milind Anantwar

Reputation: 82231

Open .docx file in new tab from anchor tag

I have included docx file for terms and condition in our project.

Now i need to open it in new tab.

I agree to this Email campaign <a title="click to view terms and conditions" style="color:blue;" target="_blank" href="{$Site.ContentPath}/public/EmailServicesTermsofUse.docx">terms and conditions</a>.

However it is downloading the file rather than opening it new tab.

How can i achieve this. I am open for any kind of solution that will meet this condition.

Thanks in Advance!!!

Upvotes: 0

Views: 5869

Answers (2)

Edward
Edward

Reputation: 194

You can't directly view doc or docx files in html pages like PDF file.

You have to use some docx extractor to extract the contents and display it in Html Page.Provide more details about your application.

For Java Application:- docx4j is suitable for extracting docx files.

Upvotes: 3

izaic3
izaic3

Reputation: 90

Most browsers by default won't load a .docx in the browser. You might have better luck hosting it as a .pdf.

Upvotes: 2

Related Questions