OfficeDev / office-js-docs

[ARCHIVED] Microsoft Office Add-ins API Reference Documentation
https://docs.microsoft.com/javascript/api/overview/office
398 stars 247 forks source link

Word Online: SmartArt disappears from document #1506

Closed abhijeetnarvekar closed 5 years ago

abhijeetnarvekar commented 5 years ago

Hi, If SmartArt is selected and context.document.getSelection(); API is called, SmartArt itself disappears from document.

Video and document attached for the issue: https://drive.google.com/open?id=1zHb-pEhI2NVVetU8MBTdmDT-L_4i5Znp

Steps to reproduce:

  1. Open document with SmartArt
  2. Select SmartArt
  3. Run the following code.
Word.run(function (context) {    
    var range = context.document.getSelection();    
    return context.sync().then(function () {        
        console.log('Inserted the text at the end of the selection.');      
    });  
}).catch(function (error) {
    console.log('Error: ' + JSON.stringify(error));
    if (error instanceof OfficeExtension.Error) {
        console.log('Debug info: ' + JSON.stringify(error.debugInfo));
    }
});
  1. Wait for 10-15 secs
  2. Refresh document(f5)
  3. SmartArt disappears

Does anyone know why this happens? Is there any solution or workaround?

Thanks, Abhijeet

Reezaali commented 5 years ago

@abhijeetnarvekar - can you post your question on Stack Overflow and use the [office-js] tag please? You'll likely get a faster answer there. This repo is used for documentation. Thank you!

kbrandl commented 5 years ago

@abhijeetnarvekar thanks for reaching out and sorry to hear that you've run into this problem. As @Reezaali mentioned, issues in this GitHub repository (OfficeDev/office-js-docs) are intended for reporting errors/problems with the API documentation.

However, instead of posting this issue to Stack Overflow as Reeza suggested, please post it to the OfficeDev/office-js repository, which members of the product team monitor for customer-reported API issues such as this. Stack Overflow is the place for "how-to" questions, but API issues/problems should be reported in the OfficeDev/office-js repository. Thank you!