Макрос Word
Макрос Word форматирует субтитры Youtube для озвучивания
Sub BALABOLKA()
'
Dim n(67), y(67) As Variant
N(1) = "[музыка]": y(1) = " "
N(2) = "[аплодисменты]": y(2) = " "
N(3) = "[смех]": y(3) = ""
N(4) = "[ __ ]": y(4) = " "
N(5) = ChrW(13): y(5) = " " 'ChrW(13) '"^p"
n(6) = " само": y(6) = " само "
n(7) = " где ": y(7) = ". где "
n(8) = " когда ": y(8) = ". когда "
n(9) = "само й": y(9) = "самой"
N(10) = " как. ": y(10) = " как "
N(11) = " так. ": y(11) = " так "
N(12) = " и ": y(12) = ". и "
N(13) = " но ": y(13) = ". но "
N(14) = " а ": y(14) = ". а "
N(15) = ",": y(15) = " "
N(16) = " .": y(16) = ". "
N(17) = "_": y(17) = " "
N(18) = "/": y(18) = " "
N(19) = ";": y(19) = ". "
N(20) = "*": y(20) = " "
N(21) = "…": y(21) = ". "
N(22) = "—": y(22) = " "
N(23) = "современ": y(23) = "со времен"
N(24) = ".. ": y(24) = ". "
N(25) = " ": y(25) = " "
N(26) = " ": y(26) = " "
N(27) = " ": y(27) = " "
n(28) = "вс-таки": y(28) = "всё-таки"
n(29) = " вс ": y(29) = " всё "
n(30) = " ещ ": y(30) = " ещё "
n(31) = "шел ": y(31) = "шёл "
n(32) = "э-э-э": y(32) = " "
n(33) = " ээ ": y(33) = " "
n(34) = "э-э": y(34) = " "
n(35) = "м-м-м": y(35) = " "
n(36) = " м-м ": y(36) = " "
n(37) = " мм ": y(37) = " "
n(38) = " ребн": y(38) = " ребён"
n(39) = "санаторий": y(39) = "сана торий"
n(40) = "соглас": y(40) = "со глас"
n(41) = "соблюд": y(41) = "со блюд"
n(42) = "созда": y(42) = "соз да"
n(43) = "собирал": y(43) = "со бирал"
n(44) = "современ": y(44) = "со времен"
n(45) = "сохран": y(45) = "со хран"
n(46) = "тана": y(46) = " тана"
n(47) = "super": y(47) = "super "
n(48) = "собственно": y(48) = "соб ственно"
n(49) = "совеща": y(49) = "со веща"
n(50) = " и пр.": y(50) = " и прочее"
n(51) = "сосредото": y(51) = "со средо то"
n(52) = "потом": y(52) = "по том"
n(53) = "на самом деле": y(53) = " "
n(54) = "на само м деле": y(54) = " "
n(55) = "псевдо": y(55) = "псевдо "
n(56) = "квази": y(56) = "квази "
n(57) = "анти": y(57) = "анти "
n(58) = "ультра": y(58) = "ультра "
n(59) = "супер": y(59) = "супер "
n(60) = "гипер": y(60) = "гипер "
n(61) = "высоко": y(61) = "высоко "
n(62) = "низко": y(62) = "низко "
n(63) = "согла": y(63) = "со гла"
n(64) = "соедин": y(64) = "со един"
n(65) = "соскоч": y(65) = "со скоч"
n(66) = "о й ": y(66) = "ой "
n(67) = "о е ": y(67) = "ое "
Selection.HomeKey Unit:=wdStory
ActiveWindow.View.Type = wdNormalView
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
For i = 1 To 67
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = n(i)
.Replacement.Text = y(i)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next i
Selection.EndKey Unit:=wdStory
ActiveWindow.View.Type = wdPageView
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
End Sub
Макрос Word форматирует литературный текст для озвучивания
Sub LITERATURA()
'
Dim n(125), y(125) As Variant
n(1) = "^#.^#.": y(1) = " "
n(2) = "^p^#": y(2) = "^p"
n(3) = "^p^#.": y(3) = "^p"
n(4) = "^p^#)": y(4) = "^p"
n(5) = "^p... ": y(5) = "^p"
n(6) = "^p.. ": y(6) = "^p"
n(7) = "^p. ": y(7) = "^p"
n(8) = "-^p": y(8) = "^p"
n(9) = "^p ": y(9) = "^p"
n(10) = "^p ^p": y(10) = "^p^p"
n(11) = "^p^p^p": y(11) = "^p^p"
n(12) = "вс-таки": y(12) = "всё-таки"
n(13) = " вс ": y(13) = " всё "
n(14) = " ещ ": y(14) = " ещё "
n(15) = "шел ": y(15) = "шёл "
n(16) = "э-э-э": y(16) = " "
n(17) = " ээ ": y(17) = " "
n(18) = "э-э": y(18) = " "
n(19) = "м-м-м": y(19) = " "
n(20) = " м-м ": y(20) = " "
n(21) = "само": y(21) = "само "
n(22) = " ребн": y(22) = " ребён"
n(23) = "санатор": y(23) = "сана тор"
n(24) = "соглас": y(24) = "сoглас"
n(25) = "соблюд": y(25) = "сoблюд"
n(26) = "созда": y(26) = "соз да"
n(27) = "собир": y(27) = "сoбир"
n(28) = "современ": y(28) = "со времен"
n(29) = "сохран": y(29) = "со хран"
n(30) = "тана": y(30) = " тана"
n(31) = "super": y(31) = "super "
n(32) = "собственно": y(32) = "сoбственно"
n(33) = "совеща": y(33) = "сoвеща"
n(34) = " и пр.": y(34) = " и прочее"
n(35) = "сосредото": y(35) = "сoсредото"
n(36) = "согла": y(36) = "со гла"
n(37) = "соедин": y(37) = "со един"
n(38) = "соскоч": y(38) = "со скоч"
n(39) = "^$.^$. ": y(39) = " "
n(40) = "^$. ^$. ": y(40) = " "
n(41) = " ^$.^$.": y(41) = " "
n(42) = " ^$. ^$.": y(42) = " "
n(43) = " ^$.": y(43) = " "
n(44) = ". ^$.": y(44) = ""
n(45) = "* * *": y(45) = " "
n(46) = "***": y(46) = " "
n(47) = "^p*": y(47) = "^p"
n(48) = "^p ": y(48) = "^p^p"
n(49) = "^p.^p": y(49) = "^p^p"
n(50) = "^p^p^p": y(50) = "^p"
n(51) = "^p^$)": y(51) = " "
n(52) = "^p^$.": y(52) = "^p"
n(53) = "–": y(53) = "-"
n(54) = "!": y(54) = "."
n(55) = "…": y(55) = "."
n(56) = "...": y(56) = "."
n(57) = "..": y(57) = "."
n(58) = " —^p": y(58) = "."
n(59) = ". . ": y(59) = ". "
n(60) = "^p ": y(60) = "^p"
n(61) = "^p.": y(61) = "^p"
n(62) = "^p)": y(62) = "^p"
n(63) = "<неи": y(63) = "^p"
n(64) = "^t": y(64) = " "
n(65) = "()": y(65) = " "
n(66) = "( )": y(66) = " "
n(67) = "(-)": y(67) = " "
n(68) = "( - )": y(68) = " "
n(69) = "(.)": y(69) = " "
n(70) = "потом": y(70) = "по том"
n(71) = "пошло": y(71) = "по шло"
n(72) = "на само м деле": y(72) = " "
n(73) = "псевдо": y(73) = "псевдо "
n(74) = ", котор": y(74) = " котор"
n(75) = "анти": y(75) = "анти "
n(76) = "ультра": y(76) = "ультра "
n(77) = "супер": y(77) = "супер "
n(78) = "гипер": y(78) = "гипер "
n(79) = "высоко": y(79) = "высоко "
n(80) = "низко": y(80) = "низко "
n(81) = " января ": y(81) = " "
n(82) = " февраля ": y(82) = " "
n(83) = " марта ": y(83) = " "
n(84) = " апреля ": y(84) = " "
n(85) = " мая ": y(85) = " "
n(86) = " июня ": y(86) = " "
n(87) = " июля ": y(87) = " "
n(88) = " августа ": y(88) = " "
n(89) = " сентября ": y(89) = " "
n(90) = " октября ": y(90) = " "
n(91) = " ноября ": y(91) = " "
n(92) = " декабря ": y(92) = " "
n(93) = "-го": y(93) = " "
n(94) = "-й": y(94) = " "
n(95) = "-е": y(95) = " "
n(96) = "-м": y(96) = " "
n(97) = "-х": y(97) = " "
n(98) = "-ти ": y(98) = " "
n(99) = " ы^$ ": y(99) = " "
n(100) = "( г.)": y(100) = "( г.)"
n(101) = " г.": y(101) = " г."
n(102) = "гг.": y(102) = ""
n(103) = " годах": y(103) = " "
n(104) = " годы": y(104) = " "
n(105) = " года": y(105) = " "
n(106) = " году": y(106) = " "
n(107) = " годы": y(107) = " "
n(108) = " ": y(108) = " "
n(109) = " ": y(109) = " "
n(110) = " .": y(110) = ". "
n(111) = " ,": y(111) = ", "
n(112) = ". . ": y(112) = ". "
n(113) = " ^#^#^#. ": y(113) = " "
n(114) = " ^#^#. ": y(114) = " "
n(115) = " ^#. ": y(115) = " "
n(116) = " часа назад": y(116) = " "
n(117) = " часов назад": y(117) = " "
n(118) = " дня назад": y(118) = " "
n(119) = " дней назад": y(119) = " "
n(120) = " сегодня в ": y(120) = " "
n(121) = " вчера в ": y(121) = " "
n(122) = "• ": y(122) = " "
n(123) = "дорогой": y(123) = "доро гой"
n(124) = "о й ": y(124) = "ой "
n(125) = "о е ": y(125) = "ое "
Selection.HomeKey Unit:=wdStory
ActiveWindow.View.Type = wdNormalView
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
For i = 1 To 125
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = n(i)
.Replacement.Text = y(i)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next i
Selection.EndKey Unit:=wdStory
ActiveWindow.View.Type = wdPageView
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
End Sub
|