Adding Tables to Word

I am trying to get tables to add into a word document and do not know how to do it, I have pasted the information below and attached the word document so that you can see the actual tables.  

I  need to create two macros and/or non- printing command buttons, one to add  new topic title tables

(This is the Topic Title Table)  each time a new topic title is added it would need to appear on the next blank page.  A page break would need to be written in the command
2.      Click here to enter Topic Title

and one that would add the section title table (this table’s numbering convention would need to follow that of the topic title section above it (ie when topic title table:2 is added all section tables inserted beneath it would follow the 2.1, 2.2, 2.3 etc  numbering and when topic title table 3 is added the sections tables beneath it would follow the 3.1, 3.2, 3.3 etc. numbering convention. (there is a potential for several section title tables to be under each topic title table).

2.1      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
(this is the Section Title Table)

When a new Topic title table is added it needs to start on the next available page number.  A simple page break in the code should work


On my template I am going to have the topic title and one section on it.

2.      Click here to enter Topic Title
2.1      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      



Below is what an example of what I am trying to accomplish, this is the topic title table added and 5 section title tables added followed by another topic title table with three title tables added.

2.      Click here to enter Topic Title
2.1      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
2.2      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
2.3      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
2.4      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
2.5      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      



3      Click here to enter Topic Title
3.1      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
3.2      "[Click here to enter Section Title]"

      
      "[Click here to enter Section Text]"

      
3.3      "[Click here to enter Section Title]"

      



I was also hoping to get the topic titles, section number and associated page numbers to auto insert to a table of contents on the first page of the document, is that possible?

Topic      Page
2.      Click here to enter topic title.
Pg Number.

3.      Click here to enter topic title
Pg Number.

4.      Click here to enter topic title
Pg Number



The table on the front would have to add a row if additional Topic Title sections were added.
Inserting-Tables-into-Word-Help-Needed.d
JuliaReynoldsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MicrosoftSavvyCommented:
What version of office are you using
0
JuliaReynoldsAuthor Commented:
2010
0
GrahamSkanRetiredCommented:
Your question is more of a project specification than a single question.

To add a table, you need some code like this:
Sub Newtable()
    Dim MyTable As Table
    
    Set MyTable = AddATable(ActiveDocument, ActiveDocument.Bookmarks("\EndOfDoc").Range, 6, 3)
End Sub
Function AddATable(doc As Document, rng As Range, iRows As Integer, iCols As Integer) As Table
    Set AddATable = doc.Tables.Add(rng, iRows, iCols)
End Function

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

JuliaReynoldsAuthor Commented:
How would you get the table to add once you have written the code
0
DrTribosCommented:
Julia, you would need to add the code then run the code. As per Graham's comment the scope of this question is a little broad... Graham has given you 2 approaches for adding tables, you can call the sub by typing NewTable in the VBA IDE Immediate window.
0
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.

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.