|
楼主 |
发表于 2023-1-2 20:15
|
显示全部楼层
- Sub 加实线宏()
- '
- ' 加实线宏 Macro
- ' 宏由 Administrator 录制,时间: 2023/01/02
- '
- '
- Selection.SetRange Start:=229, End:=229
- With Selection.Range.PageSetup
- .TopMargin = 0
- .TopMargin = 14.173115
- .BottomMargin = 0
- .BottomMargin = 14.173115
- .LeftMargin = 28.34623
- .RightMargin = 28.34623
- With .TextColumns
- .EvenlySpaced = -1
- .LineBetween = 0
- .SetCount NumColumns:=1
- .Spacing = 0
- End With
- End With
- With ActiveDocument.PageSetup
- .MirrorMargins = 0
- With .TextColumns
- .SetCount NumColumns:=1
- .EvenlySpaced = -1
- .LineBetween = 0
- .SetCount NumColumns:=1
- .Spacing = 0
- End With
- .Orientation = wdOrientLandscape
- .GutterPos = wdGutterPosLeft
- .TopMargin = 14.173115
- .BottomMargin = 14.173115
- .LeftMargin = 28.34623
- .RightMargin = 28.34623
- .Gutter = 0
- .PageWidth = 841.883057
- .PageHeight = 594.987366
- .FirstPageTray = wdPrinterDefaultBin
- .OtherPagesTray = wdPrinterDefaultBin
- .Orientation = wdOrientLandscape
- .GutterPos = wdGutterPosLeft
- .TopMargin = 14.173115
- .BottomMargin = 14.173115
- .LeftMargin = 28.34623
- .RightMargin = 28.34623
- .Gutter = 0
- .PageWidth = 841.883057
- .PageHeight = 594.987366
- .FirstPageTray = wdPrinterDefaultBin
- .OtherPagesTray = wdPrinterDefaultBin
- .HeaderDistance = 9.071
- .FooterDistance = 0.283
- .OddAndEvenPagesHeaderFooter = 0
- .DifferentFirstPageHeaderFooter = 0
- .LayoutMode = wdLayoutModeDefault
- End With
- With Options
- .MeasurementUnit = wdCentimeters
- .UseCharacterUnit = True
- End With
- Selection.SetRange Start:=0, End:=1671
- Selection.WholeStory
- ActiveDocument.Range(0, 1671).Rows.Select
- With ActiveDocument.Tables(1)
- With .Borders(wdBorderTop)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderLeft)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderBottom)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderRight)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderHorizontal)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderVertical)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- End With
- With ActiveDocument.Tables(1)
- With .Borders(wdBorderTop)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderLeft)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderBottom)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderRight)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderHorizontal)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- With .Borders(wdBorderVertical)
- .LineStyle = wdLineStyleSingle
- .LineWidth = wdLineWidth050pt
- .Color = wdColorBlack
- End With
- End With
- Selection.SetRange Start:=349, End:=349
- ActiveWindow.ActivePane.VerticalPercentScrolled = 0
- Selection.SetRange Start:=0, End:=1671
- With ActiveDocument.Range(0, 1671).Rows
- .Alignment = wdAlignRowLeft
- .LeftIndent = 0
- .HorizontalPosition = 0
- End With
- Selection.WholeStory
- Selection.Font.Name = "Times New Roman"
- With Selection.Font
- .Size = 6.5
- .SizeBi = 6.5
- End With
- With Selection
- .Range.MoveEnd Unit:=wdCharacter, Count:=1
- With .Font
- .Bold = -1
- .BoldBi = -1
- End With
- End With
- With Selection.Font
- .Bold = 0
- .BoldBi = 0
- End With
- Selection.SetRange Start:=0, End:=1671
- Selection.Cells.DistributeHeight
- With Selection
- .Cells.VerticalAlignment = wdCellAlignVerticalCenter
- .ParagraphFormat.Alignment = wdAlignParagraphJustify
- End With
- Selection.SetRange Start:=117, End:=117
- Selection.TypeText Text:="10"
- Selection.TypeText Text:="#"
- Selection.SetRange Start:=122, End:=122
- Selection.TypeText Text:="10"
- Selection.TypeText Text:="#"
- Selection.SetRange Start:=237, End:=237
- End Sub
复制代码 这是我用宏录制的一页想要我效果,空格加10#手动加了二行 其它的没加 我录了一个视频你看一下 运行了你代码文字前是有段落位的 全左对齐了 我是要表格左对齐。不是文字 。有空在帮忙看看怎样实现批量化运行。字体不知为什么加了颜色 我是用wps企业版本运行的。
|
|