• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1135
  • Last Modified:

table in word (vb.net ) repeat the header

Hi,
i am inserting a table into a word document, using this code:
oTable = doc.Range.Tables.Add(doc.Range.Bookmarks.Item("\endofdoc").Range, 4, 2)
......

i need the first row (the header of the table) to be repeated if we went into a new page..
is that dooable??
thanks
0
mte01
Asked:
mte01
  • 5
  • 3
2 Solutions
 
Bob LearnedCommented:
1) Maybe if this was Excel we could manage, but I don't think that Word has that ability.  You would have to do some magic on your own, if that's true.

2) The Word topic area is here, if you want to double-check me:

http://www.experts-exchange.com/Applications/MS_Office/Word/

Bob
0
 
mte01Author Commented:
>>TheLearnedOne

I'll be waiting for comments from other experts....
0
 
Bob LearnedCommented:
I love being wrong ;)

I found the Table option for Heading Rows Repeat, recorded a macro, and it came up with this:

   Selection.Rows.HeadingFormat = wdToggle

Bob
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
mte01Author Commented:
i think that u where wrong again ;)  (hopefully not)

sadly this didnt work with me!
oTable.Rows.HeadingFormat = Word.WdConstants.wdToggle

unless i did something wrong!
thanks bob
0
 
Bob LearnedCommented:
The Word object model is very confusing, and takes time to get to know all of it's subtle nuances.

The process in Word is to select the table, and check the menu option.  So, is the table the current selection?

Bob
0
 
mte01Author Commented:
how do i select it? since i already have a reference to it..
which is the oTable
can u post ur code if it's possible??
thanks
0
 
omegaomegaDeveloperCommented:
Hello, mte01,

What happens if you try:

    oTable.Rows(1).HeadingFormat = True

Cheers,
Randy
0
 
mte01Author Commented:
it worked
thanks
0
 
mte01Author Commented:
>>omegaomega

Can you please help in the following question: http:Q_21843172.html  ...thanks in advance!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now