To set the vertical scroll percentage on the active document in a Word add-in using the Office JavaScript API, you need to ensure that you are using the correct method to set the verticalPercentScrolled property. However, it appears that the set method is not directly available for the Word.Window object. Instead, you should use the window.update method to set properties like verticalPercentScrolled. Here’s an example of how to do this:
await Word.run(async (context) => {
const win = context.document.activeWindow;
win.set({ verticalPercentScrolled: 75 }); // This line needs to be corrected
await context.sync();
});
The correct approach would be to use the window.set method as shown, but ensure that you are calling context.sync() after setting the property to apply the changes. If you are still facing issues, please check if the API version you are using supports this property and method as expected.
References: