Цитата(Vit @ 4.1.2008, 15:34 ) | | 1. Из текста все слова засунуть в массив |
| Код | Private Sub CommandButton1_Click() Dim I As Long Dim M() As String For I = 1 To ActiveDocument.Words.Count ReDim Preserve M(I) M(I) = ActiveDocument.Words(I) Next End Sub
|
Цитата(Vit @ 4.1.2008, 15:34 ) | | Отыскать нужное слово в тексте и окрасить его другим цветом |
| Цитата | Finding text and selecting it If the Find object is accessed from the Selection object, the selection is changed when the find criteria is found. The following example selects the next occurrence of the word "Hello." If the end of the document is reached before the word "Hello" is found, the search is stopped.
With Selection.Find .Forward = True .Wrap = wdFindStop .Text = "Hello" .Execute End With
|
Цитата(Vit @ 4.1.2008, 15:34 ) | | 4. Переместить курсор на следующее/предыдущее слово |
| Код | Selection.MoveLeft Unit:=wdWord, Count:=1 Selection.MoveRight Unit:=wdWord, Count:=1
|
Добавлено через 2 минуты и 24 секунды Почитай файл C:\Program Files\Microsoft Office\OFFICE11\1049\VBAWD10.CHM.
Все идеи взял от туда.
У меня 2003 офис... |