Placing large image in Word Online not working

AG 1 Reputation point
2022-12-01T10:09:15.07+00:00

I am trying to place a large jpg image (size 17.15 MB) in Word Online. The code appears that the image was placed successfully, but it doesn't place the image in the document and there are no error messages. It is working properly in Word Desktop.

let options = {coercionType: Office.CoercionType.Image};  
Office.context.document.setSelectedDataAsync(base64, options, function(obj){  
  console.log('obj', obj)  
  context.sync().then(function(){  
    console.log('complete')  
  }, function(err){  
    if(err){console.log('failed')}  
  });  
});  

obj is returning:

status: "succeeded"  
value: {}  

The code places properly for a smaller image and on Desktop. Is there another way to check if the image placed properly or an error message?

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Word | For business | Windows
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.