View Single Post
 
Old 02-03-2014, 12:06 AM
fumei fumei is offline Windows 7 64bit Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

If you are going to use a table object, then you do not need to use selection at all. Nor do you need to use rows and columns if you are processing all cells. And again, please use code tags when you are posting code.
Code:
Sub Bombme()
Dim r As Range
Dim SentenceRange As Range
Dim aCell As Cell
Dim myTable As Table
Set myTable = ActiveDocument.Tables(1)
For Each aCell In myTable.Range.Cells
   Set r = aCell.Range
   For Each SentenceRange In r.Sentences
      If SentenceRange.Font.Bold = True Then
         SentenceRange.InsertBefore "BOMBME "
      End If
   Next
Next
End Sub
This goes through every cell in table(1). The Selection does not need to be in the table. If there is some reason you have to be in cell(3), then please state that. Please state exactly what you want.
Reply With Quote