Change adjustment value of autoshape in Office using office javascript

aikoC 6 Reputation points
2022-06-17T10:25:17.88+00:00

As I know, VBA can change the adjustment values of a shape in Microsoft Office as the example below:

Set rac = ActiveDocument.Shapes _
.AddShape(msoShapeRightArrowCallout, 10, 10, 250, 190)
With rac.Adjustments
.Item(1) = 0.5 'adjusts width of text box
.Item(2) = 0.15 'adjusts width of arrow head
.Item(3) = 0.8 'adjusts length of arrow head
.Item(4) = 0.4 'adjusts width of arrow neck
End With

Can Office Javascript do a similar thing, for example, change the angle at center for the shape 'Arc'?

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
975 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Alison McKay 81 Reputation points Microsoft Employee
    2022-06-23T22:47:33.963+00:00

    Hi @aikoC , thank you for submitting a question. The Office JavaScript APIs use a different model than VBA. Office JavaScript APIs have both Application-specific APIs that apply to only one application, and Common APIs that apply to all applications. To learn more, see: https://learn.microsoft.com/office/dev/add-ins/develop/understanding-the-javascript-api-for-office?view=common-js-preview#api-models.

    I don't know of any Common APIs that apply to shapes.

    Within the Application-specific API for Excel (the Excel JavaScript API), this documentation article describes how to create and edit shapes: https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-shapes.

    Hope this helps.

    Alison

    0 comments No comments

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.