Uncaught TypeError: Api.AddComment is not a function 6.2.0-123-linux
lex-quarkie opened this issue · 3 comments
lex-quarkie commented
I got 'Uncaught TypeError: Api.AddComment is not a function' message.
var oDocument = Api.GetDocument();
var oParagraph, oRun, result;
oParagraph = oDocument.GetElement(0);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Dear John Smith.");
oRun = oParagraph.AddText("This text was added by ONLYOFFICE Document Builder ");
result = Api.AddComment(oRun, "Hello, can u see me!", "Unknown Reviewer");
builder.SaveFile("docx", "./TEST_FILES/sample_comments.docx");
builder.CloseFile();
I am using a up-to-date version of document_buIlder 6.2.0-123 on linux mint 20
So my question is "How to correctly add a comment to ApiRun",
https://api.onlyoffice.com/docbuilder/textdocumentapi/api/addcomment have no examples on using it with ApiRun.
ShockwaveNN commented
@askonev Please take a look
askonev commented
Hello @lex-quarkie. The incorrect operation of this method is associated with a bug #49247
. The fix for this bug has been added to branch 6.4.0.
And for the correct application of the method to the Run object, you must pass in the parameters not the object itself, but an array containing Run objects
result = Api.AddComment([oRun], "Hello, can u see me!", "Unknown Reviewer");
ShockwaveNN commented
This issue was closed due to no response.