Word JavaScript API missing API to restore pictures to its original size.

Moderpach Moka 0 Reputation points
2024-12-27T06:23:12.36+00:00

In Word .Net API, I can restore picturesto its original size with the following code

foreach (Word.InlineShape shape in document.InlineShapes)
{
    if (shape.Type == Word.WdInlineShapeType.wdInlineShapePicture)
    {
        Debug.WriteLine("found a picture");
        Office.MsoTriState preLockAspectRatio = shape.LockAspectRatio;
        shape.LockAspectRatio = Office.MsoTriState.msoFalse;
        shape.ScaleWidth = 100.0F;
        shape.ScaleHeight = 100.0F;
        shape.LockAspectRatio = preLockAspectRatio;
        Debug.WriteLine("restore a picture size");
    }

}

But in Word JavaScript API, I couldn't found any API to implement that. It only support to access current size of picture.

Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
909 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,107 questions
0 comments No comments
{count} votes

Your answer

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