Some times I have to manually change 1/2pt width to 1pt (example only). So, I tried something to find and replace table cell borders width globally in my Word document.
I tried this:
Code: Select all
Private Sub cb_cmdOK_Click()
Application.ScreenUpdating = True
Dim cbfind As Long, cbreplace As Long
Dim myTable As Table, myRange As Range, myCell As Cell
For Each myTable In ActiveDocument.Tables
Set myRange = myTable.Range
For Each myCell In myRange.Cells
If myCell.Borders(wdBorderBottom).LineWidth = cbfind Then
myCell.Borders(wdBorderBottom).LineWidth = cbreplace
End If
Next myCell
Next myTable
Me.Hide
Application.ScreenUpdating = True
End Sub
Another questions:
Is it possible to find and replace top/bottom/left/right cell borders using a simple code (current code return an error without "wdBorderBottom")?
Thank you!