From: Nick on
Dave,

Thanks a lot the code works great. I am running into an error on a few of the tables.

Run-time error '5991';

Cannot access individual rows in this collection because the table has vertically merged cells.

None of the first row has vertically merged cells but later on in a few tables this is the case.

I was wondering if there was a known work around or how I would go about excluding individual tables in the macro. Thanks again for your help.



DaveLett wrote:

Hi Nick,I think you are looking for something like the following:'''remove
19-Jan-10

Hi Nick,

I think you are looking for something like the following:
'''remove bold face formatting from the first row
'''of every table except for the first table
Dim lTbl As Long

For lTbl = 2 To ActiveDocument.Tables.Count
ActiveDocument.Tables(lTbl).Rows(1).Range.Font.Bold = False
Next lTbl

HTH,
Dave

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Build a C# NotifyIcon BalloonTip Scheduled Outlook Mail Checker
http://www.eggheadcafe.com/tutorials/aspnet/0235490b-a901-42b4-9eef-7dd29b6ae909/build-a-c-notifyicon-bal.aspx
From: DaveLett on
Hi Nick,
Yes, it's known issue with merged cells. You can try the following:

Dim lTbl As Long
Dim lCl As Long

For lTbl = 2 To ActiveDocument.Tables.Count
With ActiveDocument.Tables(lTbl)
For lCl = 1 To .Range.Cells.Count
If .Range.Cells(lCl).RowIndex = 1 Then
.Range.Cells(lCl).Range.Font.Bold = True
End If
Next lCl
End With
Next lTbl

HTH,
Dave