Inserting a table into a document

Not really a developer question but I have no idea where the non-developer forum is. I'm hoping some kind person will offer a solution and everyone will refrain from responding with nasty rebukes about posting in the wrong place.

When I try to insert a table into a paragraph, it is applying the paragraph style to every cell in the table. I do not want this, I want each cell to be the 'normal' style with no numbering before it. I am not a Word expert and have no idea how to correct this or how to prevent it happening for all the tables I create. I never want this to happen to any table I ever insert. Here is what I see after inserting the table:

July 30th, 2015 12:15am

Since you're inserting a table into a paragraph, the table defaults to that paragraph's Style. You can then apply whatever other Styles you want to the table. For example:

Dim Tbl As Table
With Selection
  .Collapse wdCollapseEnd
  Set Tbl = .Tables.Add(Range:=.Range, NumRows:=8, NumColumns:=3)
  Tbl.Range.Style = wdStyleNormal
  Set Tbl = Nothing
End With

Free Windows Admin Tool Kit Click here and download it now
July 30th, 2015 12:21am

Hi "anonymous"

<<Not really a developer question but I have no idea where the non-developer forum is. I'm hoping some kind person will offer a solution and everyone will refrain from responding with nasty rebukes about posting in the wrong place.>>

Mmm, we tend to be a bit politer, here, but still you can see from Paul's reply that the assumption is that questions want "code" answers :-) I'll move the discussion to the IT Pro forum on the TechNet servers where you will find people who won't assume you want code.

FWIW, however, I don't think there's a way to force Word to behave the way you'd like. As Paul explains, a table will pick up the format of the paragraph mark starting point. So you'd need to start with a paragraph formatted as "Normal".

If you're a "keyboarder" then it might make sense to assign the style "Normal" to a keyboard shortcut (File/Options/Customize Ribbon/Keyboard - button at bottom left/Categorie: Styles. Select Normal, click in "Press new shortcut key" and press the key combination you'd like to use. Click Assign to use it.

It would also be possible to create a macro that "types" a new paragraph and applies the style to it - and assign it to a keyboard shortcut or, if you prefer the QAT (or both).

July 30th, 2015 12:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics