Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to layout something like the following:

1. A question           ...............     ...............
2. Another question     ...............     ...............
3. A third question     ...............     ...............

In other words, I want a series of questions layed out as a table, with leader dots going from the beginning to the end of certain cells. I want to avoid manually inserting dots (using a solution like leader tabs instead) and I also want to avoid doing a lot measuring work that has to be repeated if the table changes, or if I add table variants with different numbers of columns. Is this possible using Microsoft Word 2007?

On a related note: I'm still deciding on a layout/word processing application to use after replacing my old one. Would this kind of thing be easier to accomplish with Adobe InDesign or any other application?

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

There is no way to do this with the Word GUI.

Here is a Macro that will automatically fill all blank cells in a document with a tab leader that fills the cell exactly.

Sub FillCellsWithTabLeader()
'
' Fill cells with tab leader Macro
'
'

For Each tbl In ActiveDocument.Tables
    FillCells (tbl)
Next tbl

End Sub

Function FillCells(tbl)

    For Each acell In tbl.Cells

        For Each ntbl In acell.Tables
            FillCells (ntbl)
        Next ntbl

        acell.Select
        Set rngtable = acell.Range
        rngtable.MoveEnd Unit:=wdCharacter, Count:=-1
        If rngtable.Text = "" Then

            Selection.ParagraphFormat.TabStops.Add Position:=acell.Width - (acell.LeftPadding + acell.RightPadding), _
                Alignment:=wdAlignTabLeft, leader:=wdTabLeaderDots
            Selection.TypeText Text:=vbTab
        End If
    Next acell
End Function

Layout your document, then make a master backup copy before applying this macro. Then if you need to make changes just use your master to create a new copy and run the macro again.

To use this macro code:

  1. Choose File > Word Options
  2. Check 'Show Developer tab in the ribbon'
  3. Go to the Developer tab and click 'Macros'
  4. Type the name 'FillCellsWithTabLeader'
  5. Click 'Create'
  6. Copy & Paste this code over the pre-generated code stub.
  7. Close the VBA Window.
  8. Click Macros, select FillCellsWithTabLeader and click Run to run the code.
share|improve this answer
    
Ah, that's right: macros is a way to make use of my programming skills in a word processing environment. I'll try it out! –  Jakob Aug 31 '09 at 18:26
    
I gave it a quick try and it's not working properly: the tabs are of varying lengths, some too long and some too short. I understand the general principle, though, and I might try to implement similar stuff myself at some point. –  Jakob Aug 31 '09 at 18:31
    
yes sorry just noticed that, have corrected it to take into account cell padding –  subman Aug 31 '09 at 18:35
    
further corrections to the code, now it successfully fills all nested tables and split cells. –  subman Aug 31 '09 at 19:37
add comment

To accomplish this, you can create a table with as three columns and as many rows as you would like. You can remove the borders so that it appears the way you would like by right clicking on the table, selecting Table Properties... and on the Table tab, select the button Borders and Shading... This will bring up a new dialog. On the Borders tab, choose the None setting.

For the '..........', you can manually input a string of '.' the length that you like and then you can apply the same string to all cells in columns B & C by multi selecting the columns and pasting.

share|improve this answer
1  
That's a solution I considered, and I guess it's viable as long as I don't need to change column widths a lot (which I don't). However, it feels very "hacky" and I would prefer a more elegant one if possible. I have a feeling it will become a maintenance annoyance at one point or another (if I change the font size, for example). Further suggestions are welcome. –  Jakob Aug 31 '09 at 17:25
add comment

Although I didn't fully read akf's answer, my answer can be though of as identical in nature except for a finer point, where you actually use the tables limits in your favor.

My end result is the following:

End result

The process is the following:

  1. Create a table such that you have a column for every text element (e.g. the questions), the leaders and the space you left between them.
  2. Select the whole table and then remove All Limits.
  3. Select the cells that you want to have the "leader dots", then right-click and go to Borders and Shading.
  4. In the Borders tab, click in Personalize at the left.
  5. Select the dotted line (2nd) and the line width as 1 1/2 pts.
  6. In the cell layout select the center and bottom horizontal limits. Confirm.

You should get a similar result to mine. AFAIK this dialog exists even in earlier versions of Word.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.