Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 01-20-2021, 10:42 AM
gmaxey gmaxey is offline Dot Leader in 1 or all Table of Column 1, Help!!!!! Windows 10 Dot Leader in 1 or all Table of Column 1, Help!!!!! Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Not exactly sure what you are trying to do. First, it seems your code could be written:

Code:
Sub Create_Dot_Leader_1Tbl_Col_1_SpacedOut()
Dim oTbl As Table
Dim oRow As Row
Dim oCell As Cell
Dim oRng As Range
  Application.ScreenUpdating = False
  Set oTbl = Selection.Tables(1)
  oTbl.Columns(1).Select
  With Selection.ParagraphFormat
    .TextboxTightWrap = wdTightNone
    .CollapsedByDefault = False
    .TabStops.ClearAll
    .TabStops.Add Position:=InchesToPoints(5.25), _
         Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDots
  End With
  For Each oRow In oTbl.Rows
    Set oRng = oRow.Cells(1).Range
    With oRng
      .End = .End - 1
      .Collapse wdCollapseEnd
      .InsertAfter vbTab
      With .Font
        .Bold = False
        .Color = wdColorAutomatic
        .Spacing = 2
      End With
    End With
  Next oRow
  Application.ScreenUpdating = True
lbl_Exit:
  Exit Sub
End Sub

To process all tables then change to this:

Code:
Sub Create_Dot_Leader_1Tbl_Col_1_SpacedOut()
Dim oTbl As Table
Dim oRow As Row
Dim oCell As Cell
Dim oRng As Range
  Application.ScreenUpdating = False
  For Each oTbl in ActiveDocument.Tables 'Set oTbl = Selection.Tables(1)
  oTbl.Columns(1).Select
  With Selection.ParagraphFormat
    .TextboxTightWrap = wdTightNone
    .CollapsedByDefault = False
    .TabStops.ClearAll
    .TabStops.Add Position:=InchesToPoints(5.25), _
         Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDots
  End With
  For Each oRow In oTbl.Rows
    Set oRng = oRow.Cells(1).Range
    With oRng
      .End = .End - 1
      .Collapse wdCollapseEnd
      .InsertAfter vbTab
      With .Font
        .Bold = False
        .Color = wdColorAutomatic
        .Spacing = 2
      End With
    End With
  Next oRow
  Next oTbl
  Application.ScreenUpdating = True
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
dot leader table column 1



Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of Contents with authors and leader dots nanoboy Word 2 07-18-2017 01:04 PM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Dot spacing tab leader in automatic Table of Contents Beunhaas Word 1 11-25-2015 10:27 AM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Format tab leader in “Table of figures” separate from text? WTR_girl12 Word 1 09-03-2015 10:48 AM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Table of contents 2nd line dot leader right tab failure Tsingher Word 2 01-18-2015 09:21 AM
Dot Leader in 1 or all Table of Column 1, Help!!!!! Dot leader in table cells BeerStud Word 11 04-02-2014 07:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft