私はOfficeドキュメントバージョン5.0.3のみを使用しています。正常に動作します。見つけると、文書エディタでテキストを置き換えるOnlyoffice APIを呼び出してテキストを置き換える方法
Onlyoffice構成 ファイル:editor.jsp
config = {
"document": {
"fileType": "docx",
"key": "Khirz6zTPdfd7",
"title": "sample.docx",
"url": "http://192.168.0.1:8080/onlyofficeexample/files/192.168.0.1/sample.docx"
},
"documentType": "text",
"editorConfig": {
"callbackUrl": "http://192.168.0.1:8080/onlyofficeexample/IndexServlet?type=track&fileName=sample.docx&userAddress=192.168.0.1"
}
........
.......
};
var docEditor = new DocsAPI.DocEditor("placeholder", config);
setTimeout(function(){
var text_replace = {
textsearch: "~($#effective_date#$)~",
textreplace: "23/05/1991",
matchcase: false,
matchword: false,
highlight: true
};
docEditor.onReplaceText(text_replace);
}, 30000);
私はAPIを呼び出すとテキストを置換しようとしています、とOnlyofficeのAPI呼び出しで、さらにトリガ関数を作成しました。
//trigger function
onReplaceText: function (data) {
$me.trigger("onreplacetext", data)
},
は、ここで私は、この関数に
onReplaceText:function(data){
}
Common.Gateway.on('onreplacetext',_.bind(me.onReplaceText, me));
を渡されたデータに基づいてテキストを検索と置換したい最後に、私はコードの下に使用してonlyoffice APIでテキストを置き換え
@Alexander_onlyofficeご返信ありがとうございます –