|
比如表格的上下边框是双横线,而其他内部与左右边框是虚线,我使用下面的代码给表格设置底纹时,跨页时,底纹是双横线,要怎么样才是虚线?
- Sub 表格排版()
- Dim myTable As Table
- On Error Resume Next '忽略错误
- Application.ScreenUpdating = False '关闭屏幕更新
- For Each myTable In ActiveDocument.Tables
- If myTable.Range.Information(wdActiveEndPageNumber) > 3 Then
- With myTable
- .PreferredWidthType = wdPreferredWidthPercent
- .PreferredWidth = 100
- .Range.Cells.VerticalAlignment = wdCellAlignVerticalCenter
- .Rows.HeightRule = wdRowHeightAtLeast
- .Rows.Height = CentimetersToPoints(0.6)
- .Rows.LeftIndent = CentimetersToPoints(0)
- .TopPadding = CentimetersToPoints(0)
- .BottomPadding = CentimetersToPoints(0)
- .LeftPadding = CentimetersToPoints(0.1)
- .RightPadding = CentimetersToPoints(0.1)
- .Spacing = 0
- .AllowPageBreaks = True
- .AllowAutoFit = True
- With .Range.ParagraphFormat
- .LineSpacingRule = wdLineSpaceMultiple
- .LineSpacing = LinesToPoints(1)
- End With
- With .Range
- .Font.NameFarEast = "宋体"
- .Font.NameAscii = "Arial Narrow"
- .Font.NameOther = "Arial Narrow"
- .Font.Name = "Arial Narrow"
- .Font.Size = 10
- End With
- With .Borders(wdBorderLeft)
- .LineStyle = wdLineStyleDot
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderRight)
- .LineStyle = wdLineStyleDot
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderTop)
- .LineStyle = wdLineStyleDouble
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderBottom)
- .LineStyle = wdLineStyleDouble
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderHorizontal)
- .LineStyle = wdLineStyleDot
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- With .Borders(wdBorderVertical)
- .LineStyle = wdLineStyleDot
- .LineWidth = wdLineWidth050pt
- .Color = wdColorAutomatic
- End With
- .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
- .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
- .Borders.Shadow = False
- End With
- With Options
- .DefaultBorderLineStyle = wdLineStyleDot
- .DefaultBorderLineWidth = wdLineWidth050pt
- .DefaultBorderColor = wdColorAutomatic
- End With
- Exit Sub
- End If
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|