Linking Many Tables To A Master Document

J

jbell

Hi All,

I’m working in Word 2000 and trying to create a master Word document that
has tables linked to it from another Word document. The Word document that
contains the tables is automatically created by another, outside, program. In
other words, when I run this third-party program, its output is a Word
document that contains a number of tables. I need a way to link these tables
to my master document. The tricky part is that every time I run the
third-party program I get a new document with a different set of tables. The
good news is that the tables are the same size and have the same formatting
every time, only the data in the tables changes.

I’ve tried assigning a Bookmark to each table every time the third-party
program runs and that works, but is not practical due to the number of tables
(about 75) each time it runs. I’ve also tried exporting the tables en-masse
to an Excel file and then creating links to the master document using
Insert/File/Range based on cell positions. This works as far as moving the
data is concerned, but I lose table column formatting in the transition to
Excel.

Am I on the right track here? Any suggestions would be greatly appreciated.

Thanks,
 
D

Doug Robbins - Word MVP

Why is the assignment of the bookmarks not practical? Are you doing it
manually? It would be very easy to write the necessary code to assign the
bookmarks automatically. In fact, the following will assign bookmark names
of Table1, Table2, etc in the blink of an eye:

Dim i As Long
With ActiveDocument
For i = 1 To .Tables.Count
.Bookmarks.Add Name:="Table" & i, Range:=.Tables(i).Range
Next i
End With


--
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, originally posted via msnews.microsoft.com
 
J

jbell

Doug,

Thanks for taking the time to respond, and for that bit of code.
I suspected that autonumbering of bookmarks was possible, I just didn't know
how to make it happen. Your assumption that I was doing it manually is
correct since I have no experience using VB in word. If necessary I'll learn,
and give your solution a try.

Thanks again,
 
D

Doug Robbins - Word MVP

See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?†at:

http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm


--
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, originally posted via msnews.microsoft.com
 
J

jbell

Doug,

Thanks for the link to the mini-tutorial.
Using those instructions I did a small scale test and it seems to work fine.
You MVPs are the greatest, thank you for supporting such a valuable resource.
 

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