View Single Post
  #1   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

I tweaked your code a little and it fixed it. I changed Paragraphs(1)
to Characters(1) in this macro and my other table macros and it no
longer gives me an error msg when I run them. Here's the slightly
tweaked code:

Sub ConvertRefTables()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
If oTbl.Cell(1, 1).Range.Characters(1).Style = _
ActiveDocument.Styles("Table Header") Then
With oTbl
.Range.Characters(1).Style =
ActiveDocument.Styles("Reftable")
.PreferredWidthType = wdPreferredWidthPercent
.PreferredWidth = 75
End With
End If
Next oTbl
End Sub

The first characters in my table always have the correct style. If the
table ever has any other style applied to it, that style comes in
later. Thanks again for your help Macropod.