title: How can use the Word API to programmatically open a document with the Bookmark at the top of the page?
body: <p>Using the following code to open a Word document at a bookmark</p>
  
  <pre><code> Object readOnly = true;
                  Object isVisible = true;
                  Object missing = System.Reflection.Missing.Value;
  
                  Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
                  Microsoft.Office.Interop.Word.Document wordDoc = new Microsoft.Office.Interop.Word.Document();
  
                  wordApp.Visible = true;
                  wordDoc = wordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing,
                      ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible,
                      ref missing, ref missing, ref missing, ref missing);
                  object bookmarkName = BookMarkName;
                  if (wordDoc.Bookmarks.Exists(bookmarkName.ToString()))
                  {
                      Microsoft.Office.Interop.Word.Bookmark bookmark = wordDoc.Bookmarks.get_Item(ref bookmarkName);
                      bookmark.Select();
                    }
  </code></pre>
  
  <p>The Word document shows the bookmark, but not at the top of the page. Is there a way of showing the Bookmark at the top of the page as it is shown using Goto-> Bookmark?</p>
  
  <p>The code suggested in StackOverflow Question</p>
  
  <blockquote>
    <p>How do I use the Microsoft Word API and Bookmarks feature to programmatically open a Word document to a specific location?</p>
  </blockquote>
  
  <p>which is </p>
  
  <pre><code>Object item = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToBookmark;
                      Object whichitem = Microsoft.Office.Interop.Word.WdGoToDirection.wdGoToFirst;
                      Object count = 1;
                      Object name = BookMarkName;
                      wordDoc.GoTo(ref item, ref missing, ref missing, ref name);
  </code></pre>
  
  <p>does not work and gives all the errors described in the post.</p>