Я отвечаю за надстройку слова и мне нужно добавить новые функции, но я терплю неудачу и, надеюсь, кто-нибудь может мне помочь:)
У меня есть кнопка, и если эта кнопка нажатапервое вхождение данной строки должно быть выбрано в тексте слова.
Спасибо!
package.json "@ types / office-js": "0.0.75",
изменить:
HTML-код
<a href="#" class="button-select-text (click)="selectText(givenString)">
Угловой код
public selectText(givenString: string) {
console.log('String to select: ' + givenString);
if (this._common.officeVersion[0] !== '16') {
this._common.getWordFile('', Office.FileType.Text)
.then(response => {
console.log('Text from Word: ' + response.fileContent);
// todo now select/mark the givenString in word itself
});
} else {
Word.run(context => {
const wordText = context.load(context.document.body, 'text');
console.log('Text from Word: ' + wordText);
// todo now select/mark the givenString in word itself
});
}
}