Results 1 to 11 of 11

Thread: Possible to Select Only Nested Tables

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    VBAX Regular
    Joined
    Apr 2018
    Posts
    14
    Location
    Dim objTable As Word.Table
    For Each objTable In ActiveDocument.Tables
      objTable.Range.Font.Name = "TimesNewRoman"
      objTable.Range.Font.Size = 10
      With objTable
        .RightPadding = 5 'measurement in points
        .LeftPadding = 5 'measurement in points
        .TopPadding = 0 'measurement in points
        .BottomPadding = 0 'measurement in points
        .Rows.SpaceBetweenColumns = CentimetersToPoints(0.2)
        .Rows.AllowBreakAcrossPages = False
        .Rows.Alignment = wdAlignRowCenter
        .Rows.HeightRule = wdRowHeightAuto
        .Shading.Texture = wdTextureSolid
        .Shading.ForegroundPatternColor = wdColorWhite
        .Borders.InsideLineStyle = wdLineStyleSingle
        .Borders.InsideLineWidth = wdLineWidth050pt
        .Borders.OutsideLineStyle = wdLineStyleNone
        .Borders.InsideColor = wdColorGray25
        .Range.Cells.VerticalAlignment = wdAlignVerticalTop
        .PreferredWidthType = wdPreferredWidthPercent
        .PreferredWidth = 100
        With .Rows(1)
          .Range.Font.Name = "TimesNewRoman"
          .Range.Font.Size = 10
          .Range.Font.Bold = True
          .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
          .Cells.VerticalAlignment = wdAlignVerticalTop
          .Shading.Texture = wdTexture10Percent
          .Shading.ForegroundPatternColorIndex = wdBlack
          .Shading.BackgroundPatternColorIndex = wdWhite
          .Borders.InsideLineStyle = wdLineStyleSingle
          .Borders.InsideLineWidth = wdLineWidth050pt
          .Borders.InsideColor = wdColorGray25
          .Borders(wdBorderTop).LineStyle = wdLineStyleSingle
          .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
          .Borders(wdBorderTop).LineWidth = wdLineWidth150pt
          .Borders(wdBorderBottom).LineWidth = wdLineWidth150pt
          .Borders(wdBorderTop).Color = wdColorBlack
          .Borders(wdBorderBottom).Color = wdColorBlack
          .HeadingFormat = True
        End With 'end the first row settings
        With .Rows(.Rows.Count) 'the last row in the table
          .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
          .Borders(wdBorderBottom).LineWidth = wdLineWidth150pt
          .Borders(wdBorderBottom).Color = wdColorBlack
          .Borders.InsideLineStyle = wdLineStyleSingle
          .Borders.InsideLineWidth = wdLineWidth050pt
          .Borders.InsideColor = wdColorGray25
        End With 'end the last row settings
      End With 'end that table settings
    Next objTable
    Last edited by macropod; 04-18-2018 at 03:15 PM. Reason: Added code tags & formatting

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •