0

Подскажите, как мне подчеркнуть строку где было найдено слово?

        var wordApp = new Word.Application();
        wordApp.Visible = true;
        wordApp.Documents.Open(@"C:\Users\Администратор\Desktop\1.docx");
        Word.Find findWords = wordApp.Selection.Find;
        findWords.Text = "Ключевое слово";

1 ответ 1

1
var path = "Путь";
var wordApp = new Word.Application();
var document = wordApp.Documents.Open(path);
var range = worDocument.Content;
range.Find.ClearFormatting();

if (range.Find.Execute("Что ищешь"))
{
    range.Font.Underline = Word.WdUnderline.wdUnderlineSingle;
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.