title: Further looking into "Avoid context.sync in loops"
body: <p>Article <a href="https://docs.microsoft.com/en-us/office/dev/add-ins/concepts/correlated-objects-pattern" rel="nofollow noreferrer">Avoid using the context.sync method in loops</a> renders incredible help on the Word add-in I am developing. I see huge performance improvement after adopting the technique introduced in this article.</p>
  
  <p>This really made my day. Now there is only one sync-loop left that I am not sure how to deal with it. Here is the sample code. The culprit function with context.sync() runs inside a loop, forming the sync-loop that drives me nuts. Any idea how to optimize it? For some reason, the two functions cannot be merged.</p>
  
  <pre><code>async function testFunc (ranges: Word.RangeCollection) {
    for (let i=0; i&lt;1000; i++) {
      await culprit(ranges.items[i]);
    }
  }
  async function culprit (range: Word.Range) {
    range.load("text");
    await range.context.sync();
  }
  </code></pre>