Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

How do I report a  bug in Office 2003 on Tables properties?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hank Freeman - 20 May 2005 19:24 GMT
In MS Word you can set a table properties you can set "Repeat  as Header row
on the top of each Page"... However, when trying to do it in VBA behind
Office in a Macro as listed below it does not work.
Sub Macro1()
   Selection.Tables(1).Rows.HeadingFormat = True
End Sub

Please advise the correct VBA Syntax..
Additional documentation available upon request
Jezebel - 20 May 2005 22:57 GMT
The bug is in your code. You have to specify which rows you want as heading
rows. Word is smart enough to know that you don't want ALL of them ...

Selection.Tables(1).Rows(2).HeadingFormat = true

Setting a row to true also sets the rows above it; setting a row to false
also clears the rows below it.

> In MS Word you can set a table properties you can set "Repeat  as Header
> row
[quoted text clipped - 6 lines]
> Please advise the correct VBA Syntax..
> Additional documentation available upon request
Pat Garard - 20 May 2005 23:03 GMT
G'Day Hank,

Your Macro works perfectly as long as you have made a
SELECTION that includes a Table (or the Insertion Point
is already within the Header Row of a Table).

You need to generalise it to:

Sub Macro1()
   ActiveDocument.Tables(1).Rows.HeadingFormat = True
End Sub

OR

Sub Macro1()
   Dim intX as Integer
   intX = 1 ' Or whatever ...
   ActiveDocument.Tables(intX).Rows.HeadingFormat = True
End Sub
Signature

Regards,
Pat Garard
Melbourne, Australia
_______________________

> In MS Word you can set a table properties you can set "Repeat  as Header
> row
[quoted text clipped - 6 lines]
> Please advise the correct VBA Syntax..
> Additional documentation available upon request
bbowen8@gmail.com - 13 Jun 2005 21:35 GMT
I had a lot of trouble with this feature too. I basically discovered
that my entire table (not just the first row) was set to repeat. So
what I had to do was select the table, turn off "repeat as header row"
for the whole table, and then just select the first row and set it
again. But I had a lot of tables and wrote this macro which cleaned
them all up by turning it off, then on again only for row 1.

Bill

Sub HeadingRows()
Dim n As Integer

For n = 1 To ActiveDocument.Tables.Count
   ActiveDocument.Tables(n).Select
       With Selection
           .Rows.HeadingFormat = False
           .Rows(1).HeadingFormat = True
       End With
Next

End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.