View Single Post
  #8   Report Post  
Posted to microsoft.public.word.tables
Tom Tom is offline
external usenet poster
 
Posts: 61
Default suddenly experiencing error messages with table macro

Macropod,

You were kind enough to help me with the code, but it just didn't work
for me. I think if I switch what I'm trying to do a little, I can get
around the problem.

What if I could change my IF statement so that instead of saying, "If
in cell(1,1) it has the Table Header style, THEN do this...

To the following:

IF in cell(1,1) the first word is "Note," THEN do this....

How would I apply that new IF statement to the original macro?

Sub ConvertRefTables()

Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
If oTbl.Cell(1, 1).Range.Style = _
ActiveDocument.Styles("Table Header") Then
With oTbl

.Style = ActiveDocument.Styles("Reftable")
.PreferredWidthType = wdPreferredWidthPercent
.PreferredWidth = 75

End With
End If
Next oTbl
End Sub

Thanks in advance for your help.

Tom