×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Word - table and BorderBottom

Word - table and BorderBottom

Word - table and BorderBottom

(OP)
I have a table in Word with 5 columns:
|---------------------------------------------|
| Entrances   |       |       |       |       |
|---------------------------------------------| 
I have some text in first column and a bookmark in the second (cell) column. I can go to that bookmarks and enter a text, move to the next cell / column (by MoveRight Unit:=wdCell) and enter more text. When I enter the text in the last column, I can still do MoveRight Unit:=wdCell a couple of times - which adds another row of cells, and I am in the next row in the second column and I can keep adding my text. And all is great.

Now my user wants me to make 2nd, 3rd, 4th and 5th cell with BorderBottom (but not first column with the word "Entrances"), so when I am in the cell where I enter the text, I can do:

CODE

With Selection.Borders(wdBorderBottom)
    .LineStyle = Options.DefaultBorderLineStyle
    .LineWidth = Options.DefaultBorderLineWidth
    .Color = Options.DefaultBorderColor
End With 

Which places the border on the bottom of the cell. Great.

But when I create/move to the next row, bottom border moves down, and the original cell is left without the bottom border. sad
How can set the bottom border in the cell and have it stay there when I create a new row of cells in the table?


---- Andy

There is a great need for a sarcasm font.

RE: Word - table and BorderBottom

Andy, what happens if you define an OUTSIDE border for the Table? I’m not at my laptop so I couldn’t test that.

So what part of this is coded? At some point, the first column will have a new value and you’ll need a bottom border in column 1.

Of course you could do that in Excel (with Entrances on each row) using Conditional Formatting to manage the in-table borders and font color to make Entrances appear invisible.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: Word - table and BorderBottom

(OP)
I am redoing a letter one Department has for years.
This portion looks like this.



So in my Word template I have this:



In line "Entrances will be constructed at Station(s)" they used to have just 4 spots for Entrances with bottom lines as all other cells above. That was easy because I did not have to add any rows in the table. But now I allow them to have unlimited number of Entrances, so I keep adding rows to my table as needed.

The lines are left over from the time they entered all of this data by hand, and now they want to continue with the lines.

It is not the end of the world, I can make them like it the way it is now...


---- Andy

There is a great need for a sarcasm font.

RE: Word - table and BorderBottom

Well actually you have a Table with up to 7 columns and lots of merged cells at various places.

If you’re talking about this kind of form but allowing rows to be added at the bottom of each table where you have ...

Entrances will be constructed at Station(s)

...with the RED lines under the 2 entries, your example of This portion, does not have a border under the Entrances...???

Not sure what the issue is.

Maybe a pic displaying the issue?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: Word - table and BorderBottom

(OP)
Yes, the "7 columns and lots of merged cells at various places" was done by somebody else. I just deal with the bottom portion of this table.

So what I have right now (as a final product) is (the top portion), and what users may want is (the bottom):



BTW - I still have to talk to the users because what I have here and what they drew (in red) on their end is not the same thing. And I may be just chasing something a lot more complicated (split more cells)... ponder


---- Andy

There is a great need for a sarcasm font.

RE: Word - table and BorderBottom

Assuming the table containing "Additional Length of Drive" is separate from the one before it, as your image shows, inserting new rows is quite straightforward. For example:
ActiveDocument.Tables(1).Rows.Add
where 1 is the table #.
If the table containing "Additional Length of Drive" is not separate from the one before it, inserting new rows is a little more involved:. For example:

CODE

With ActiveDocument.Range
  With .Find
  .ClearFormatting
  .Text = "Additional Length of Drive"
  .Execute
  End With
  If .Find.Found = True Then
    If .Information(wdWithInTable) = True Then
      With .Duplicate
        .InsertBreak Type:=wdColumnBreak
        .Tables(1).Rows.Add
        .Tables(1).Range.Characters.Last.Next.Delete
      End With
    End If
  End If
End With 

Cheers
Paul Edstein
[MS MVP - Word]

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close