title: Office JavaScript API: scrolling within a document
body: <p>I'm working on a side project using the Microsoft Office JavaScript APIs. I have been relying on the <a href="https://docs.microsoft.com/en-us/office/dev/add-ins/reference/javascript-api-for-office" rel="nofollow noreferrer">documentation</a> to find my way around, but I've hit a wall trying to find something in the docs (perhaps it isn't there because it doesn't exist).</p>
  
  <p>Recently I was implementing programmatic scrolling to a certain position within a Word document. I am currently using the <a href="https://docs.microsoft.com/en-us/javascript/api/word/word.range?view=office-js#select-selectionmode-" rel="nofollow noreferrer">Range.select</a> method to accomplish this, but the scrolling behavior isn't exactly what I want: the method ensures that the document scrolls so that the range is visible, but it doesn't always end up in a consistent location relative to the viewport. I.e. sometimes the range is at the bottom of the document, sometimes it's in the middle, and sometimes it's at the top.</p>
  
  <p>I'm wondering: is there a way with the Office JavaScript APIs to exert more precise control over the scroll position of the document? In my ideal world, there would be something analogous to <code>scrollTo</code> (but of course I can't use <code>scrollTo</code> directly, as my add-in cannot directly access the parent window where the document is rendered).</p>