Добавление вставки вертикального А4
This commit is contained in:
203
MacrosList.bas
203
MacrosList.bas
@@ -54,6 +54,35 @@ Sub ML_AddListA4()
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ML_AddListA4vert()
|
||||
'for debug
|
||||
'MsgBox "Запуск функции вставки листа А4 вертикального"
|
||||
|
||||
|
||||
'Loas inserting as new chapter/breaks
|
||||
Selection.InsertBreak Type:=wdSectionBreakNextPage
|
||||
Selection.InsertBreak Type:=wdSectionBreakNextPage
|
||||
Selection.MoveLeft Unit:=wdCharacter, Count:=1
|
||||
|
||||
'wdPaperSize - https://learn.microsoft.com/en-us/office/vba/api/word.wdpapersize
|
||||
'wdPaperA3 = 6
|
||||
'wdPaperA4 = 7
|
||||
|
||||
'WdOrientation - https://learn.microsoft.com/ru-ru/office/vba/api/word.wdorientation
|
||||
'wdOrientPortrait = 0
|
||||
'wdOrientLandscape =1
|
||||
|
||||
With Selection.PageSetup
|
||||
.PaperSize = wdPaperA4
|
||||
.Orientation = wdOrientPortrait
|
||||
.TopMargin = CentimetersToPoints(2)
|
||||
.BottomMargin = CentimetersToPoints(2)
|
||||
.LeftMargin = CentimetersToPoints(3)
|
||||
.RightMargin = CentimetersToPoints(1.5)
|
||||
End With
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ML_AddListA3()
|
||||
'for debug
|
||||
'MsgBox "Запуск функции вставки листа А3"
|
||||
@@ -68,6 +97,10 @@ Sub ML_AddListA3()
|
||||
'wdPaperA3 = 6
|
||||
'wdPaperA4 = 7
|
||||
|
||||
'WdOrientation - https://learn.microsoft.com/ru-ru/office/vba/api/word.wdorientation
|
||||
'wdOrientPortrait = 0
|
||||
'wdOrientLandscape =1
|
||||
|
||||
With Selection.PageSetup
|
||||
.PaperSize = wdPaperA3
|
||||
.Orientation = wdOrientLandscape
|
||||
@@ -360,6 +393,176 @@ Sub ML_PicFormatter()
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ML_AddStyle()
|
||||
|
||||
'Добавление стиля для названия рисунка
|
||||
ActiveDocument.Styles.Add Name:="Название Рисунка", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
ActiveDocument.Styles("Название Рисунка").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("Название Рисунка").Font
|
||||
.Name = "Arial"
|
||||
.Size = 14
|
||||
.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 = 6
|
||||
.SpaceAfterAuto = False
|
||||
.LineSpacingRule = wdLineSpace1pt5
|
||||
.Alignment = wdAlignParagraphCenter
|
||||
.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
|
||||
|
||||
'Добавление стиля для названия таблицы
|
||||
ActiveDocument.Styles.Add Name:="Название Таблицы", Type:= _
|
||||
wdStyleTypeParagraph
|
||||
ActiveDocument.Styles("Название Таблицы").AutomaticallyUpdate = False
|
||||
With ActiveDocument.Styles("Название Таблицы").Font
|
||||
.Name = "Arial"
|
||||
.Size = 14
|
||||
.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
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ML_TestMacros()
|
||||
|
||||
MsgBox ("Хоба!")
|
||||
|
||||
Reference in New Issue
Block a user