0

I want to insert text into word, but I can not find the api;

let docEditor = new DocsAPI.DocEditor("placeholder", config);

docEditor.insertText('simple text') // this is I want to do, but insertText is undefine

1 Answers1

1

You can read this url https://api.onlyoffice.com/docbuilder/textdocumentapi
sample code:

builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is just a sample text. Nothing special.");
builder.SaveFile("docx", "AddText.docx");
builder.CloseFile();
Esset
  • 916
  • 2
  • 15
  • 17
probelover
  • 11
  • 2