Добавление стилей
This commit is contained in:
652
MacrosList.bas
652
MacrosList.bas
@@ -252,6 +252,17 @@ Dim CurrTbl As Table
|
||||
Selection.Cells.VerticalAlignment = wdCellAlignVerticalCenter
|
||||
'MsgBox ("первая строка отформатирована")
|
||||
|
||||
'MsgBox ("вставка заголовка")
|
||||
'Label = WdCaptionLabelID - https://learn.microsoft.com/ru-ru/office/vba/api/word.wdcaptionlabelid
|
||||
'при испоьзовании WdCaptionLabelID вставляется английское название
|
||||
'wdCaptionEquation = -3 формула
|
||||
'wdCaptionFigure = -1 рисунок
|
||||
'wdCaptionTable = -2 таблица
|
||||
'Position = WdCaptionPosition - https://learn.microsoft.com/ru-ru/office/vba/api/word.wdcaptionposition
|
||||
'wdCaptionPositionAbove = 0 до объекта
|
||||
'wdCaptionPositionBelow = 1 после объекта
|
||||
Selection.InsertCaption Label:="Таблица", Title:=" - ", Position:=wdCaptionPositionAbove
|
||||
|
||||
'MsgBox ("Done!")
|
||||
'MsgBox ("Готово!")
|
||||
|
||||
@@ -395,13 +406,39 @@ End Sub
|
||||
|
||||
Sub ML_AddStyle()
|
||||
|
||||
'Добавление стиля для названия рисунка
|
||||
ActiveDocument.Styles.Add Name:="Название Рисунка", Type:= _
|
||||
'Добавление стилей:
|
||||
'ГОСТ Обычный текст
|
||||
'ГОСТ Название Рисунка
|
||||
'ГОСТ Название Таблицы
|
||||
'
|
||||
'Добавление стилей маркированного и нумерованного списков идет через вызовы
|
||||
'отдельных макросов, это нужно для того, чтобы коллекция стилей успевала обновляться
|
||||
|
||||
'Добавление стиля ГОСТ Обычный текст
|
||||
'ActiveDocument.Styles.Add Name:="ГОСТ Обычный текст", Type:= _
|
||||
' wdStyleTypeCharacter
|
||||
' With ActiveDocument.Styles("ГОСТ Обычный текст").Font
|
||||
' .Name = "Arial"
|
||||
' .Size = 12
|
||||
' .Color = wdColorAutomatic
|
||||
' End With
|
||||
' With ActiveDocument.Styles("ГОСТ Обычный текст").Font
|
||||
' With .Shading
|
||||
' .Texture = wdTextureNone
|
||||
' .ForegroundPatternColor = wdColorAutomatic
|
||||
' .BackgroundPatternColor = wdColorAutomatic
|
||||
' End With
|
||||
' .Borders(1).LineStyle = wdLineStyleNone
|
||||
' .Borders.Shadow = False
|
||||
' End With
|
||||
|
||||
'Добавление стиля ГОСТ Обычный текст
|
||||
ActiveDocument.Styles.Add Name:="ГОСТ Обычный текст", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
ActiveDocument.Styles("Название Рисунка").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("Название Рисунка").Font
|
||||
ActiveDocument.Styles("ГОСТ Обычный текст").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("ГОСТ Обычный текст").Font
|
||||
.Name = "Arial"
|
||||
.Size = 14
|
||||
.Size = 12
|
||||
.Bold = False
|
||||
.Italic = False
|
||||
.Underline = wdUnderlineNone
|
||||
@@ -427,7 +464,92 @@ ActiveDocument.Styles.Add Name:="Название Рисунка", Type:= _
|
||||
.StylisticSet = wdStylisticSetDefault
|
||||
.ContextualAlternates = 0
|
||||
End With
|
||||
With ActiveDocument.Styles("Название Рисунка").ParagraphFormat
|
||||
With ActiveDocument.Styles("ГОСТ Обычный текст").ParagraphFormat
|
||||
.LeftIndent = CentimetersToPoints(0)
|
||||
.RightIndent = CentimetersToPoints(0)
|
||||
.SpaceBefore = 0
|
||||
.SpaceBeforeAuto = False
|
||||
.SpaceAfter = 0
|
||||
.SpaceAfterAuto = False
|
||||
.LineSpacingRule = wdLineSpace1pt5
|
||||
.Alignment = wdAlignParagraphJustify
|
||||
.WidowControl = True
|
||||
.KeepWithNext = False
|
||||
.KeepTogether = False
|
||||
.PageBreakBefore = False
|
||||
.NoLineNumber = False
|
||||
.Hyphenation = True
|
||||
.FirstLineIndent = CentimetersToPoints(1.5)
|
||||
.OutlineLevel = wdOutlineLevelBodyText
|
||||
.CharacterUnitLeftIndent = 0
|
||||
.CharacterUnitRightIndent = 0
|
||||
.CharacterUnitFirstLineIndent = 0
|
||||
.LineUnitBefore = 0
|
||||
.LineUnitAfter = 0
|
||||
.MirrorIndents = False
|
||||
.TextboxTightWrap = wdTightNone
|
||||
End With
|
||||
ActiveDocument.Styles("ГОСТ Обычный текст"). _
|
||||
NoSpaceBetweenParagraphsOfSameStyle = True
|
||||
ActiveDocument.Styles("ГОСТ Обычный текст").ParagraphFormat.TabStops. _
|
||||
ClearAll
|
||||
With ActiveDocument.Styles("ГОСТ Обычный текст").ParagraphFormat
|
||||
With .Shading
|
||||
.Texture = wdTextureNone
|
||||
.ForegroundPatternColor = wdColorAutomatic
|
||||
.BackgroundPatternColor = wdColorAutomatic
|
||||
End With
|
||||
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
|
||||
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
|
||||
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
|
||||
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
|
||||
With .Borders
|
||||
.DistanceFromTop = 1
|
||||
.DistanceFromLeft = 4
|
||||
.DistanceFromBottom = 1
|
||||
.DistanceFromRight = 4
|
||||
.Shadow = False
|
||||
End With
|
||||
End With
|
||||
ActiveDocument.Styles("ГОСТ Обычный текст").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("ГОСТ Обычный текст").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Обычный текст").Frame.Delete
|
||||
|
||||
|
||||
|
||||
'Добавление стиля для названия рисунка
|
||||
ActiveDocument.Styles.Add Name:="ГОСТ Название Рисунка", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
ActiveDocument.Styles("ГОСТ Название Рисунка").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("ГОСТ Название Рисунка").Font
|
||||
.Name = "Arial"
|
||||
.Size = 12
|
||||
.Bold = False
|
||||
.Italic = False
|
||||
.Underline = wdUnderlineNone
|
||||
.UnderlineColor = wdColorAutomatic
|
||||
.StrikeThrough = False
|
||||
.DoubleStrikeThrough = False
|
||||
.Outline = False
|
||||
.Emboss = False
|
||||
.Shadow = False
|
||||
.Hidden = False
|
||||
.SmallCaps = False
|
||||
.AllCaps = False
|
||||
.Color = wdColorAutomatic
|
||||
.Engrave = False
|
||||
.Superscript = False
|
||||
.Subscript = False
|
||||
.Scaling = 100
|
||||
.Kerning = 0
|
||||
.Animation = wdAnimationNone
|
||||
.Ligatures = wdLigaturesNone
|
||||
.NumberSpacing = wdNumberSpacingDefault
|
||||
.NumberForm = wdNumberFormDefault
|
||||
.StylisticSet = wdStylisticSetDefault
|
||||
.ContextualAlternates = 0
|
||||
End With
|
||||
With ActiveDocument.Styles("ГОСТ Название Рисунка").ParagraphFormat
|
||||
.LeftIndent = CentimetersToPoints(0)
|
||||
.RightIndent = CentimetersToPoints(0)
|
||||
.SpaceBefore = 0
|
||||
@@ -452,11 +574,11 @@ ActiveDocument.Styles.Add Name:="Название Рисунка", Type:= _
|
||||
.MirrorIndents = False
|
||||
.TextboxTightWrap = wdTightNone
|
||||
End With
|
||||
ActiveDocument.Styles("Название Рисунка"). _
|
||||
ActiveDocument.Styles("ГОСТ Название Рисунка"). _
|
||||
NoSpaceBetweenParagraphsOfSameStyle = False
|
||||
ActiveDocument.Styles("Название Рисунка").ParagraphFormat.TabStops. _
|
||||
ActiveDocument.Styles("ГОСТ Название Рисунка").ParagraphFormat.TabStops. _
|
||||
ClearAll
|
||||
With ActiveDocument.Styles("Название Рисунка").ParagraphFormat
|
||||
With ActiveDocument.Styles("ГОСТ Название Рисунка").ParagraphFormat
|
||||
With .Shading
|
||||
.Texture = wdTextureNone
|
||||
.ForegroundPatternColor = wdColorAutomatic
|
||||
@@ -474,17 +596,17 @@ ActiveDocument.Styles.Add Name:="Название Рисунка", Type:= _
|
||||
.Shadow = False
|
||||
End With
|
||||
End With
|
||||
ActiveDocument.Styles("Название Рисунка").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("Название Рисунка").NoProofing = False
|
||||
ActiveDocument.Styles("Название Рисунка").Frame.Delete
|
||||
ActiveDocument.Styles("ГОСТ Название Рисунка").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("ГОСТ Название Рисунка").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Название Рисунка").Frame.Delete
|
||||
|
||||
'Добавление стиля для названия таблицы
|
||||
ActiveDocument.Styles.Add Name:="Название Таблицы", Type:= _
|
||||
ActiveDocument.Styles.Add Name:="ГОСТ Название Таблицы", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
ActiveDocument.Styles("Название Таблицы").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("Название Таблицы").Font
|
||||
ActiveDocument.Styles("ГОСТ Название Таблицы").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("ГОСТ Название Таблицы").Font
|
||||
.Name = "Arial"
|
||||
.Size = 14
|
||||
.Size = 12
|
||||
.Bold = False
|
||||
.Italic = False
|
||||
.Underline = wdUnderlineNone
|
||||
@@ -510,7 +632,7 @@ ActiveDocument.Styles.Add Name:="Название Таблицы", Type:= _
|
||||
.StylisticSet = wdStylisticSetDefault
|
||||
.ContextualAlternates = 0
|
||||
End With
|
||||
With ActiveDocument.Styles("Название Таблицы").ParagraphFormat
|
||||
With ActiveDocument.Styles("ГОСТ Название Таблицы").ParagraphFormat
|
||||
.LeftIndent = CentimetersToPoints(0)
|
||||
.RightIndent = CentimetersToPoints(0)
|
||||
.SpaceBefore = 0
|
||||
@@ -535,10 +657,10 @@ ActiveDocument.Styles.Add Name:="Название Таблицы", Type:= _
|
||||
.MirrorIndents = False
|
||||
.TextboxTightWrap = wdTightNone
|
||||
End With
|
||||
ActiveDocument.Styles("Название Таблицы"). _
|
||||
ActiveDocument.Styles("ГОСТ Название Таблицы"). _
|
||||
NoSpaceBetweenParagraphsOfSameStyle = False
|
||||
ActiveDocument.Styles("Название Таблицы").ParagraphFormat.TabStops.ClearAll
|
||||
With ActiveDocument.Styles("Название Таблицы").ParagraphFormat
|
||||
ActiveDocument.Styles("ГОСТ Название Таблицы").ParagraphFormat.TabStops.ClearAll
|
||||
With ActiveDocument.Styles("ГОСТ Название Таблицы").ParagraphFormat
|
||||
With .Shading
|
||||
.Texture = wdTextureNone
|
||||
.ForegroundPatternColor = wdColorAutomatic
|
||||
@@ -556,14 +678,439 @@ ActiveDocument.Styles.Add Name:="Название Таблицы", Type:= _
|
||||
.Shadow = False
|
||||
End With
|
||||
End With
|
||||
ActiveDocument.Styles("Название Таблицы").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("Название Таблицы").NoProofing = False
|
||||
ActiveDocument.Styles("Название Таблицы").Frame.Delete
|
||||
ActiveDocument.Styles("ГОСТ Название Таблицы").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("ГОСТ Название Таблицы").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Название Таблицы").Frame.Delete
|
||||
|
||||
Selection.ClearFormatting
|
||||
'добавление стиля нумерованного списка
|
||||
Call ML_AddNumList
|
||||
Selection.ClearFormatting
|
||||
'добавление стиля маркированного списка
|
||||
Call ML_AddMarkerList
|
||||
Selection.ClearFormatting
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ML_TestMacros()
|
||||
|
||||
MsgBox ("Хоба!")
|
||||
|
||||
'MsgBox "Papersize = " & Selection.PageSetup.PaperSize
|
||||
'wdPaperSize - https://learn.microsoft.com/en-us/office/vba/api/word.wdpapersize
|
||||
'wdPaperA3 = 6
|
||||
'wdPaperA4 = 7
|
||||
|
||||
'If Selection.PageSetup.PaperSize = 7 Then
|
||||
' MsgBox ("A4")
|
||||
'End If
|
||||
|
||||
'If Selection.PageSetup.PaperSize = 6 Then
|
||||
' MsgBox ("A3")
|
||||
'End If
|
||||
|
||||
MsgBox "Selection.Type = " & Selection.Type
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ML_AddNumList()
|
||||
'Добавление стиля нумерованного списка
|
||||
ActiveDocument.Styles.Add Name:="ГОСТ Список цифра", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
With ActiveDocument.Styles("ГОСТ Список цифра")
|
||||
.AutomaticallyUpdate = False
|
||||
.BaseStyle = "ГОСТ Обычный текст"
|
||||
.NextParagraphStyle = "ГОСТ Список цифра"
|
||||
End With
|
||||
With ActiveDocument.Styles("ГОСТ Список цифра").Font
|
||||
.Name = "Arial"
|
||||
.Size = 12
|
||||
.Bold = False
|
||||
.Italic = False
|
||||
.Underline = wdUnderlineNone
|
||||
.UnderlineColor = wdColorAutomatic
|
||||
.StrikeThrough = False
|
||||
.DoubleStrikeThrough = False
|
||||
.Outline = False
|
||||
.Emboss = False
|
||||
.Shadow = False
|
||||
.Hidden = False
|
||||
.SmallCaps = False
|
||||
.AllCaps = False
|
||||
.Color = wdColorAutomatic
|
||||
.Engrave = False
|
||||
.Superscript = False
|
||||
.Subscript = False
|
||||
.Scaling = 100
|
||||
.Kerning = 0
|
||||
.Animation = wdAnimationNone
|
||||
.Ligatures = wdLigaturesNone
|
||||
.NumberSpacing = wdNumberSpacingDefault
|
||||
.NumberForm = wdNumberFormDefault
|
||||
.StylisticSet = wdStylisticSetDefault
|
||||
.ContextualAlternates = 0
|
||||
End With
|
||||
With ActiveDocument.Styles("ГОСТ Список цифра").ParagraphFormat
|
||||
.LeftIndent = CentimetersToPoints(0)
|
||||
.RightIndent = CentimetersToPoints(0)
|
||||
.SpaceBefore = 0
|
||||
.SpaceBeforeAuto = False
|
||||
.SpaceAfter = 0
|
||||
.SpaceAfterAuto = False
|
||||
.LineSpacingRule = wdLineSpaceSingle
|
||||
.Alignment = wdAlignParagraphLeft
|
||||
.WidowControl = True
|
||||
.KeepWithNext = False
|
||||
.KeepTogether = False
|
||||
.PageBreakBefore = False
|
||||
.NoLineNumber = False
|
||||
.Hyphenation = True
|
||||
.FirstLineIndent = CentimetersToPoints(0)
|
||||
.OutlineLevel = wdOutlineLevelBodyText
|
||||
.CharacterUnitLeftIndent = 0
|
||||
.CharacterUnitRightIndent = 0
|
||||
.CharacterUnitFirstLineIndent = 0
|
||||
.LineUnitBefore = 0
|
||||
.LineUnitAfter = 0
|
||||
.MirrorIndents = False
|
||||
.TextboxTightWrap = wdTightNone
|
||||
End With
|
||||
ActiveDocument.Styles("ГОСТ Список цифра"). _
|
||||
NoSpaceBetweenParagraphsOfSameStyle = False
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").ParagraphFormat.TabStops. _
|
||||
ClearAll
|
||||
With ActiveDocument.Styles("ГОСТ Список цифра").ParagraphFormat
|
||||
With .Shading
|
||||
.Texture = wdTextureNone
|
||||
.ForegroundPatternColor = wdColorAutomatic
|
||||
.BackgroundPatternColor = wdColorAutomatic
|
||||
End With
|
||||
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
|
||||
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
|
||||
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
|
||||
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
|
||||
With .Borders
|
||||
.DistanceFromTop = 1
|
||||
.DistanceFromLeft = 4
|
||||
.DistanceFromBottom = 1
|
||||
.DistanceFromRight = 4
|
||||
.Shadow = False
|
||||
End With
|
||||
End With
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").Frame.Delete
|
||||
|
||||
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(1)
|
||||
.NumberFormat = "%1"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 0
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = "ГОСТ Список цифра"
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(2)
|
||||
.NumberFormat = "%1.%2"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 1
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(3)
|
||||
.NumberFormat = "%1.%2.%3"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 2
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(4)
|
||||
.NumberFormat = "%1.%2.%3.%4"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 3
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(5)
|
||||
.NumberFormat = "%1.%2.%3.%4.%5"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 4
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(6)
|
||||
.NumberFormat = "%1.%2.%3.%4.%5.%6"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 5
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(7)
|
||||
.NumberFormat = "%1.%2.%3.%4.%5.%6.%7"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 6
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(8)
|
||||
.NumberFormat = "%1.%2.%3.%4.%5.%6.%7.%8"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 7
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(2).ListLevels(9)
|
||||
.NumberFormat = "%1.%2.%3.%4.%5.%6.%7.%8.%9"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
.NumberStyle = wdListNumberStyleArabic
|
||||
.NumberPosition = CentimetersToPoints(1.25)
|
||||
.Alignment = wdListLevelAlignLeft
|
||||
.TextPosition = CentimetersToPoints(0)
|
||||
.TabPosition = wdUndefined
|
||||
.ResetOnHigher = 8
|
||||
.StartAt = 1
|
||||
With .Font
|
||||
.Bold = wdUndefined
|
||||
.Italic = wdUndefined
|
||||
.StrikeThrough = wdUndefined
|
||||
.Subscript = wdUndefined
|
||||
.Superscript = wdUndefined
|
||||
.Shadow = wdUndefined
|
||||
.Outline = wdUndefined
|
||||
.Emboss = wdUndefined
|
||||
.Engrave = wdUndefined
|
||||
.AllCaps = wdUndefined
|
||||
.Hidden = wdUndefined
|
||||
.Underline = wdUndefined
|
||||
.Color = wdUndefined
|
||||
.Size = wdUndefined
|
||||
.Animation = wdUndefined
|
||||
.DoubleStrikeThrough = wdUndefined
|
||||
.Name = ""
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
ListGalleries(wdOutlineNumberGallery).ListTemplates(2).Name = "NameDigit"
|
||||
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:=ListGalleries(wdOutlineNumberGallery).ListTemplates(2)
|
||||
'ListGalleries(wdOutlineNumberGallery).ListTemplates (2), _
|
||||
'ContinuePreviousList:=False, ApplyTo:=wdListApplyToWholeList, _
|
||||
'DefaultListBehavior:=wdWord10ListBehavior
|
||||
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").LanguageID = wdRussian
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Список цифра").Frame.Delete
|
||||
|
||||
'Selection.ClearFormatting
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ML_AddMarkerList()
|
||||
|
||||
'Добавление стиля маркированного списка
|
||||
ActiveDocument.Styles.Add Name:="ГОСТ Список маркер (-)", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").AutomaticallyUpdate = _
|
||||
False
|
||||
|
||||
With ActiveDocument.Styles("ГОСТ Список маркер (-)")
|
||||
.AutomaticallyUpdate = False
|
||||
.BaseStyle = "ГОСТ Обычный текст"
|
||||
.NextParagraphStyle = "ГОСТ Список маркер (-)"
|
||||
End With
|
||||
With ActiveDocument.Styles("ГОСТ Список маркер (-)").Font
|
||||
.Name = "Arial"
|
||||
.Size = 12
|
||||
@@ -639,14 +1186,14 @@ ActiveDocument.Styles.Add Name:="ГОСТ Список маркер (-)", Type:=
|
||||
.Shadow = False
|
||||
End With
|
||||
End With
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").LanguageID = wdEnglishUS
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").Frame.Delete
|
||||
Selection.MoveUp Unit:=wdLine, Count:=4
|
||||
Selection.MoveDown Unit:=wdLine, Count:=2
|
||||
Selection.MoveUp Unit:=wdLine, Count:=3
|
||||
Selection.MoveLeft Unit:=wdCharacter, Count:=27
|
||||
Selection.MoveDown Unit:=wdLine, Count:=10, Extend:=wdExtend
|
||||
'ActiveDocument.Styles("ГОСТ Список маркер (-)").LanguageID = wdEnglishUS
|
||||
'ActiveDocument.Styles("ГОСТ Список маркер (-)").NoProofing = False
|
||||
'ActiveDocument.Styles("ГОСТ Список маркер (-)").Frame.Delete
|
||||
''Selection.MoveUp Unit:=wdLine, Count:=4
|
||||
''Selection.MoveDown Unit:=wdLine, Count:=2
|
||||
''Selection.MoveUp Unit:=wdLine, Count:=3
|
||||
''Selection.MoveLeft Unit:=wdCharacter, Count:=27
|
||||
''Selection.MoveDown Unit:=wdLine, Count:=10, Extend:=wdExtend
|
||||
With ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
|
||||
.NumberFormat = "-"
|
||||
.TrailingCharacter = wdTrailingSpace
|
||||
@@ -926,35 +1473,16 @@ ActiveDocument.Styles.Add Name:="ГОСТ Список маркер (-)", Type:=
|
||||
End With
|
||||
.LinkedStyle = ""
|
||||
End With
|
||||
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).Name = ""
|
||||
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
|
||||
ListGalleries(wdOutlineNumberGallery).ListTemplates(1), _
|
||||
ContinuePreviousList:=False, ApplyTo:=wdListApplyToWholeList, _
|
||||
DefaultListBehavior:=wdWord10ListBehavior
|
||||
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).Name = "NameMinus"
|
||||
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:=ListGalleries(wdOutlineNumberGallery).ListTemplates(1)
|
||||
'ListGalleries(wdOutlineNumberGallery).ListTemplates (1), _
|
||||
'ContinuePreviousList:=False, ApplyTo:=wdListApplyToWholeList, _
|
||||
'DefaultListBehavior:=wdWord10ListBehavior
|
||||
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").LanguageID = wdEnglishUS
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").NoProofing = False
|
||||
ActiveDocument.Styles("ГОСТ Список маркер (-)").Frame.Delete
|
||||
|
||||
'Selection.ClearFormatting
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ML_TestMacros()
|
||||
|
||||
MsgBox ("Хоба!")
|
||||
|
||||
MsgBox "Papersize = " & Selection.PageSetup.PaperSize
|
||||
'wdPaperSize - https://learn.microsoft.com/en-us/office/vba/api/word.wdpapersize
|
||||
'wdPaperA3 = 6
|
||||
'wdPaperA4 = 7
|
||||
|
||||
If Selection.PageSetup.PaperSize = 7 Then
|
||||
MsgBox ("A4")
|
||||
End If
|
||||
|
||||
If Selection.PageSetup.PaperSize = 6 Then
|
||||
MsgBox ("A3")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user