最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

如何設(shè)置Word表格的VBA代碼

  發(fā)布時(shí)間:2013-04-03 17:09:14   作者:佚名   我要評(píng)論
今天小編教大家如何設(shè)置Word表格的VBA代碼,用得著的朋友可以一起看看。
VBA代碼設(shè)置Word表格屬性。

  Dim i As Table, N As Integer

  On Error Resume Next ’忽略錯(cuò)誤

  Application.ScreenUpdating = False ’關(guān)閉屏幕更新

  For Each i In ActiveDocument.Tables ’在表格中循環(huán)

  With i

  .Style = "列表型 4" ’將所有表格設(shè)置為"列表型4"的樣式

  With .Borders ‘邊框

  .InsideLineStyle = wdLineStyleSingle ’設(shè)置內(nèi)部邊框線條

  End With

  With .Rows(1).Borders(wdBorderBottom) ‘第一行的底邊框

  .LineStyle = wdLineStyleDouble ‘雙線型

  .LineWidth = wdLineWidth050pt

  .Color = wdColorAutomatic

  End With

  If .Rows.Count > 1 Then ’ 如果表格行數(shù)大于1

  If Len(.Cell(2, 1).Range) <= 2 Then ’如果第二行第一列不為空

  With .Rows(2).Shading ’設(shè)置底紋

  .Texture = wdTextureNone ’無底底紋

  .ForegroundPatternColor = wdColorAutomatic

  .BackgroundPatternColor = wdColorGray125

  End With

  End If

  End If

  For N = 2 To .Columns.Count ’從第二列到最后一列

  .Columns(N).Select ’單元格對(duì)齊方式為中部居中

  Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

  Selection.Cells.VerticalAlignment = wdCellAlignVerticalCenter

  Next N

  End With

  Next i

  Application.ScreenUpdating = True

  以上的代碼功能為:表格集合中的循環(huán)與對(duì)單元格邊框的設(shè)置。

相關(guān)文章

最新評(píng)論

北安市| 永胜县| 齐齐哈尔市| 景泰县| 中西区| 迁西县| 台前县| 鸡东县| 诸城市| 苍南县| 涡阳县| 陆河县| 邯郸县| 中卫市| 闻喜县| 西华县| 安阳市| 安达市| 西吉县| 乡宁县| 山东| 玉门市| 赤峰市| 探索| 肇州县| 灵台县| 莱西市| 宁明县| 吴旗县| 墨玉县| 东平县| 翁牛特旗| 出国| 双牌县| 饶河县| 榆林市| 金门县| 云和县| 安岳县| 内黄县| 措美县|