Reply
 
Thread Tools Display Modes
  #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.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
error messages when using table formula after moving column tot's hunguponword Tables 3 November 26th 06 03:27 AM
Losing textbox on table Jack Tables 13 November 21st 06 03:09 AM
Change Table Background Macro Jeff Ditty Tables 1 March 28th 06 04:32 AM
Select specific cells in table via macro Bill Sturdevant Microsoft Word Help 1 July 27th 05 03:01 PM
Word 2003 Table AutoFormat vs Macro vs VBA Kind writer/user/programmer Tables 1 October 28th 04 03:14 PM


All times are GMT +1. The time now is 12:52 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"