title: Create edit link to document in sharepoint
body: <p>I have a document library in sharepoint storing a word document.</p>
  
  <p>If I click on the link to the document I get a dialog box with "you want to open this file in readonly or editmode etc" and can open it in edit mode, change it, save it directly in word an the changes are saved in the document library.</p>
  
  <p>The link to the file in the document library looks like this:</p>
  
  <pre><code>&lt;a onfocus="OnLink(this)" 
     href="/test/DocLib2/wordtest.docx" 
     onmousedown="return VerifyHref(this,event,'1','SharePoint.OpenDocuments','')"     
     onclick="return DispEx(this,event,'TRUE','FALSE','FALSE',
              'SharePoint.OpenDocuments.3','1', 'SharePoint.OpenDocuments',
              '','','','1','0','0','0x7fffffffffffffff','','')"
  &gt;wordtest&lt;/a&gt;
  </code></pre>
  
  <p>How do I create this link in my own web part where I have the name of the file and document library? Without just copying the above code, that wouldn't be a good idea...</p>
  
  <p>Is there some "official" method to achieve this?</p>