SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small problem that I need to open word documents from button click event from SharePoint document library. Can anyone help me on this?

New Word Document opened:

a) A new word document opened from clicking the create button from the main application insert data and will get saved in the document library directly.

b) Allows user to write data and will get saved by saving the document.

share|improve this question

New Document, create a link like this:

<a href="/ServerRelativePath/_layouts/FormServer.aspx?XsnLocation=/ServerRelativePath/List%20name/Forms/template.xsn&SaveLocation=%2F/ServerRelativePath%2FList%20Name&Source=%2F/ServerRelativePath%2FList%2520Name%2FForms%2FCV%2520AllItems%2Easpx&DefaultItemOpen=1">Create new document</a>

To open a special document, create a link like this (providing you have the SPFile object):

"http://path/_layouts/FormServer.aspx?XmlLocation=http://path/" +       item.File.Url.Replace(" ", "%20") + "&OpenIn=Browser";
share|improve this answer

Refer this post to open a word document on click:

Open word document from codebehind - e.g Response.Write with some javascript

You can further decide to spit/call this function on client click of any button.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.