Solved

Microsoft Word Table - Header, Body, Footer

Posted on 2016-08-04
7
45 Views
Last Modified: 2016-08-04
I am creating some financial tables using VB Script into existing Word Document tables

Similar to a HTML Table that has thead, tbody, tfoot tags to partition areas for automated insert of rows, cells,
I need this in the Word Tables.

How can I establish areas in a table in such a way that row adds remain within that area?
0
Comment
Question by:maxdbase
  • 4
  • 3
7 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41743183
Word tables can treat the first row(s) as special if they set as are Repeat Header Rows. This means that they will be automatically repeated at the top of the rows shown on each page.

Otherwise they are no special rows in a Word table.

You could try to emulate the effect by having three tables where the paragraphs that keep them separate are set to use minimum vertical space.

How is the table to be used? Manual insertion could be guided by different  colours or different border styles. Automated insertion could also do that.
0
 

Author Comment

by:maxdbase
ID: 41743234
The three table may be the best route.  There are numerous tables, over 100 in the document.
Each one shall be populated from a data source using vb script.

Here is an example:
http://www.screencast.com/t/gUevYHOEvoU
Note the separate rows for rev and for expense.  I will need to populate these independently

The three table idea is the closest I can imagine to what I need.  However, it would be more convenient to have a way to manage the areas in one table.
0
 

Author Comment

by:maxdbase
ID: 41743250
Here is another example of a challenging table.  It has headers in the detail.
So I will be updated multiple collections of rows from vb script:

http://www.screencast.com/t/pOHAQThcP

I am going to see if bookmarking would contain these areas.  

Keeping in one table would prevent column widths from going haywire.

Need help.  Any ideas appreciated
0
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.

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41743314
Bookmarking, differential colouring or horizontal borders would each be usable in distinguishing between the conceptual parts of the table.

The main thing to know is how they are going to be used.

In some situations, it might be profitable to use VBA to input to the correct part of the table, or even to combine the table parts into one when all inputting is done.
0
 

Author Comment

by:maxdbase
ID: 41743395
I'm using vb script to populate the table.  
That, I believe, is similar to vba.
It sounds like you are saying I can address the  conceptual sections using something like
MyBookMark.rows.addrow.
I think you have helped me a lot.  I'll wait for one last response then reward points
along with my appreciation to you for helping me out.
I'm surprised Microsoft has not added regions to their table object model.
It would be killer!
Cheers,
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 41743462
The main difference between VBA and VBScript is the environment.

VBA runs inside a VBA host (Excel, Access, etc). It can address other VBA applications (e.g. it can use the Word object model extension in Excel -hosted VBA:
mytable.rows.add(mytable.rows(2))

Open in new window

0
 

Author Closing Comment

by:maxdbase
ID: 41743475
Thank you for the insight and help.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question