Heading Rows Repeat / Includetext - XML -XSL

P

Peter Berg

I include a large XML table formatted by XSL and it works fine, but now I
want to combine this with "Heading Rows Repeat", and this does not work. The
table looses the supplementary headings everytime F9 is pressed.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?UGV0ZXIgQmVyZw==?=,
I include a large XML table formatted by XSL and it works fine, but now I
want to combine this with "Heading Rows Repeat", and this does not work. The
table looses the supplementary headings everytime F9 is pressed.
IncludeText is a field. F9 updates the field. All editing and almost all
formatting applied to a field will be lost when a field is updated. you can try
adding the following switch to the IncludeText field code, but no guarantees it
will work for this particular setting:
\* MergeFormat

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
P

Peter Berg

Thank you Cindy for your answer, but sorry, it can not be the solution. You
see, my work depends in a very high degree upon the MergeFormat. All the
extra formating like bold and text size has been remembered, but not the
heading information. I belive, it is a Word error, but perhaps there is a
work around?
 
R

Robert

Peter,

I tried to find a solution to this problem about 2 years ago, and couldn't
find one. You are correct, this is a bug, and Microsoft knows it but won't
fix it. Let me know if you find a work around.

Robert
 
R

Robert

Cindy,

There are many linked tables in my document, and it is very time consuming
to locate each one in the document, and reset the "heading rows repeat"
setting. Is there a macro that could do this automatically for all tables in
the document.

Thank you.

Robert
 
C

Cindy M -WordMVP-

Hi Robert,
I tried to find a solution to this problem about 2 years ago, and couldn't
find one. You are correct, this is a bug, and Microsoft knows it but won't
fix it.
Did Microsoft say it was a bug, or that it's workign "as designed"?
MergeFormat doesn't take everything into account, just certain formatting
aspects. You may or may not agree with the design, but it's only a bug if it's
not working as it was designed :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

Cindy M -WordMVP-

Hi Robert,
There are many linked tables in my document, and it is very time consuming
to locate each one in the document, and reset the "heading rows repeat"
setting. Is there a macro that could do this automatically for all tables in
the document.
Yes, this should be possible. Sample code to set the first row of each table to
repeat:

Sub SetHeadingRows()
For each tbl in ActiveDocument.Tables
tbl.Rows(1).HeadingFormat = True
Next
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
R

Robert

Cindy,

I think they said something to the effect of it being recognized as a
product "limitation", and that they knew it should be fixed, and that they
have had requests for it to be fixed, but that the demand wasn't high enough
to justify adding it to their fix/improvements list.

Robert
 
R

Robert

Thank you.

Cindy M -WordMVP- said:
Hi Robert,

Yes, this should be possible. Sample code to set the first row of each table to
repeat:

Sub SetHeadingRows()
For each tbl in ActiveDocument.Tables
tbl.Rows(1).HeadingFormat = True
Next
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
P

Peter Berg

I have tryed your suggestion, but receives an error saying: "Cannot access
individual rows in this collection because the table has vertically merged
cells"?

Thanks anyway, Peter
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Um9iZXJ0?=,
I think they said something to the effect of it being recognized as a
product "limitation", and that they knew it should be fixed, and that they
have had requests for it to be fixed, but that the demand wasn't high enough
to justify adding it to their fix/improvements list.
Ahhh. OK. I'll put that on my "nag" list <g>

Cindy Meister
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?UGV0ZXIgQmVyZw==?=,
I have tryed your suggestion, but receives an error saying: "Cannot access
individual rows in this collection because the table has vertically merged
cells"?
"Vertically merged cells" means that not every row / column has the same
number of cells (some have been selected and merged into a single cell).

Hmmm. Since you can set the HeaderRows in the user interface, it ought to be
possible using a macro. We just have to out-smart Word...

See if this does the job:

Sub SetHeaderRowsWithMergedCells()
Dim tbl As Word.Table

For Each tbl In ActiveDocument.Tables
tbl.Select
Selection.Cells(1).Select
Selection.Expand wdRow
Selection.Rows.HeadingFormat = True
Next
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
P

Peter Berg

Thank you, Cindy. You solved my problem! I am very impressed :)

Just one thing further, I have search for a book describing this sort of
problems and more generally VBA in Word and Excel down to objects and
methods, do you have a good one, you use yourself?

Best regards, Peter
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?UGV0ZXIgQmVyZw==?=,
I have search for a book describing this sort of
problems and more generally VBA in Word and Excel down to objects and
methods, do you have a good one, you use yourself?
This isn't very modest... Besides Word's VBA Help files, I mostly use
the book I wrote together with three other MVPs :) It's in German, from
MS Press: Word-Programmierung, das Handbuch.

For the English-speaking people, I usually recommend the Word
2000 VBA Programmer's Reference from WROX.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
P

Peter Berg

Thank you again !

Cindy M -WordMVP- said:
Hi =?Utf-8?B?UGV0ZXIgQmVyZw==?=,

This isn't very modest... Besides Word's VBA Help files, I mostly use
the book I wrote together with three other MVPs :) It's in German, from
MS Press: Word-Programmierung, das Handbuch.

For the English-speaking people, I usually recommend the Word
2000 VBA Programmer's Reference from WROX.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top