script-lab icon indicating copy to clipboard operation
script-lab copied to clipboard

InvalidArgument error when apply Indent in Word 2016 MSO(16.0.4738.1000)32-bit)

Open ankushsolao opened this issue 6 years ago • 1 comments

Bug Report

  • Host: WORD 2016 MSO(16.0.4738.1000)32-bit)
  • OS: Windows 10
  • Browser: Word Add-Ins/IE 11.3321.14393.0 (Update Version 11.0.160)
  • Environment: Test environment

Expected behavior:

The indent should be applied to the selected text/paragraph.

Actual behavior:

I am trying to use Script-Lab on Word 2016 MSO(16.0.4738.1000)32-bit) and facing an issue when I apply indent to selected text.

Steps to Reproduce:

  1. Open Word
  2. Go Insert menu, add Script-Lab add-in
  3. Search Indent in samples menu
  4. Enter some text and select the same
  5. Click "Indent first paragraph" under "Try it out" header

Failure Logs:

{ "description": "InvalidArgument", "message": "InvalidArgument", "name": "RichApi.Error", "code": "InvalidArgument", "traceMessages": [], "innerError": null, "debugInfo": { "code": "InvalidArgument", "message": "InvalidArgument", "errorLocation": "" }, "stack": "InvalidArgument: InvalidArgument\n at Anonymous function (https://appsforoffice.microsoft.com/lib/1/hosted/word-win32-16.01.js:24:288131)\n at o (https://script-lab-runner.azureedge.net/static/js/1.30a5fcfe.chunk.js:1:2779072)\n at Anonymous function (https://script-lab-runner.azureedge.net/static/js/1.30a5fcfe.chunk.js:1:2779219)\n at u (https://script-lab-runner.azureedge.net/static/js/1.30a5fcfe.chunk.js:1:314565)" }

Screenshot:

scriptlab

ankushsolao avatar Dec 11 '19 11:12 ankushsolao

Hi @ankushsolao,

The build of Word you're on only supports the WordApi 1.1 requirement set. That sample in Script Lab uses ParagraphCollection.getFirst, which was introduced in WordApi 1.3. If you want to see the only Office JavaScript APIs supported by this requirement set, use this link to see the properly versioned reference documentation.

There might be a different issue this uncovers in Script Lab. I think you're supposed to only be able to see samples that are supported in your current environment. Tagging @Zlatkovsky to help answer this question.

AlexJerabek avatar Dec 20 '19 00:12 AlexJerabek

I don't see any code that filters the samples by current environment.

wandyezj avatar May 06 '24 20:05 wandyezj