It has the text New Roman Cyr, 14pt. It is necessary to create a macro that will do the following: Words written in bold type, complements the cool color makes a double underline. I never joined Visual Basic, because for me it is not clear. Oh, great sages of programming, I bow to your majesty;)
1 answer
Yes please:)
Sub macros() 'Берем текст нашего документа текущего Set Content = ActiveDocument.Content 'Слова в нем Set Words = Content.Words 'Теперь бегаем по всем словам For i = 1 To Words.Count Set currentWord = Words.Item(i) 'Проверяем не жирный ли шрифт, тут можно проверять чего угодно, там вариантов масса If currentWord.Font.Bold = True Then 'устанавливаем цвет для данного слова currentWord.Font.Color = wdColorRed 'и подчеркиваем дважды currentWord.Font.Underline = wdUnderlineDouble End If Next End Sub
Something like that. I worked, there will be errors, please contact. Perhaps there are even functions that produce an array of words in the text according to a certain criterion and work naturally faster, so I can say that the code is not optimal.
- how awesome ... thank you so much)) and what kind of literature can add a little bit to my knowledge, which is not present at the moment, in the syntax of this language?) - ksuzka
- And I do not even know, I taught this language by examples and by trial and error. For VBS, I have only one very convenient HTMLHelp (* .chm), which describes the basic functions and structures of the language. Only somewhere I sowed this file. - Dex
|