Using word tables for database query/reporting

J

JustSomeGuy

I have two Word tables, each in its own Word .doc.

Word Table 1 is a table of project titles (column 1) and project details
(columns 2-x).

Word Table 2 is an empty, carefully formatted ‘Project Summary†table. (like
a report ‘screen’)

The idea is to peruse Table 1, select Project (row), click a macrobutton,
and generate a Project Summary (Table 2), populated with the data from
project row 1. Then, select some other project (row) in Table 1, and
generate another populated Project Summary (Table 2) for that project, etc,
until a total of x Project Summary tables have been generated.

I know how to make macrobuttons, but am unclear on how to construct the
syntax that would be needed.

The overall goal is to achieve something akin to a database (using just Word
tables) that, when manually queried, can generate populated, formatted MS
Word 'display tables'.

This could be used to generate formatted ‘bios’ from a Word table (database)
of employees, or to generate project summary tables for use in proposals to
show past performance, etc.
 
D

Doug Robbins - Word MVP

To get the information out of a cell in a table, use

Dim myrange as range
Set myrange = ActiveDocument.Tables(1).Cell(rownum, colnum).Range
myrange.End = myrange.End -1 'strips off the end of cell marker

myrange.Text will now contain the text that was in the cell.

You may however find a more efficient way to do what you want by using
Table1 as a mailmerge data source for a maindocument that contains table 2.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

JustSomeGuy

Doug, You were right; a 'mail merge' from table 1 to table 2 worked like a
charm. A good example of how 'merge' isn't just for letters! Thanks for the
suggestion.
 

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