Feedback by UserVoice

Petr Simon

My feedback

  1. 8 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Feature Requests and Feedback » Add-in: Word  ·  Flag idea as inappropriate…  ·  Admin →
    Petr Simon shared this idea  · 
  2. 6 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Feature Requests and Feedback » Add-in: Word  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    Petr Simon commented  · 

    Finally had a chance to test it. Thank you again. Just in case someone runs into this thread, this is how I do it.

    Word.run(function (context) {
    var range = context.document.getSelection();
    context.load(range.paragraphs);
    return context.sync()
    .then(function () {
    var para = range.paragraphs.items[0];
    for (var i = 0; i < totalBefore; i++) {
    para = para.getPrevious();
    loadedParagraphs.splice(0, 0, para);
    }

    para = range.paragraphs.items[0];
    for (var i = 0; i < totalAfter; i++) {
    para = para.getNext();
    loadedParagraphs.push(para);
    }

    loadedParagraphs.forEach(function (p) {
    context.load(p);
    });

    loadedParagraphs.splice(totalBefore, 0, range.paragraphs.items[0]);
    })
    .then(context.sync)
    .then(processParagraphs)
    .then(context.sync)
    })

    An error occurred while saving the comment
    Petr Simon commented  · 

    That's great! Thank you.

    Petr Simon shared this idea  · 

Feedback and Knowledge Base