Добрый вечер. Есть Есть макрос, который форматирует текст. Пару букв один шрифт, следующие три буквы - другой шрифт и т.д. Но, когда макрос запускаю, то он редактирует только одну строчку. Как это сделать для всего громадного документа? СПАСИБО ЗАРАНЕЕ!!!
Пробовал и через if... then...else, но как-то видимо не то писал..
Макрос 1
Sub Макрос3()
'
' Макрос3 Макрос
'
'
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=11, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=10, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=6, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=7, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=6
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=8
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=8, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveLeft Unit:=wdCharacter, Count:=69
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 10
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=8
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Size = 11
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 10
Selection.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=11
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=12
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
End Sub
Макрос 2
Sub Макрос()
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=11, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=10, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=6, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=7, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=6
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=8
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=8, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveLeft Unit:=wdCharacter, Count:=69
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 10
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=8
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Size = 11
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 10
Selection.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=11
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=12
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Do
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=11, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=10, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=6, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=7, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=6
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=8
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=5, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik2"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Name = "Antik3"
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=8, Extend:=wdExtend
Selection.Font.Name = "Antik4"
Selection.MoveLeft Unit:=wdCharacter, Count:=69
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 10
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=8
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.Font.Size = 11
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 10
Selection.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Size = 14
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=2
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=11
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=12
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Loop Until Selection.Find.Execute = False
End Sub
Макрос 2 останавливает выполнение, либо в конце 5-6 строчки, либо в конце абзаца...