locked
Inserting a table into a document RRS feed

  • Question

  • 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:

    Thursday, July 30, 2015 12:15 AM

Answers

  • 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).


    Cindy Meister, VSTO/Word MVP, my blog

    • Proposed as answer by George123345 Friday, July 31, 2015 1:54 AM
    • Marked as answer by George123345 Friday, August 7, 2015 9:32 AM
    Thursday, July 30, 2015 4:40 PM
  • You can quickly apply the Normal style to a selection of cells by pressing Ctrl+Shift+N which is a default shortcut. You can also assign your own shortcut, as Cindy has already explained.


    Stefan Blom, Microsoft Word MVP

    • Proposed as answer by Charles Kenyon Monday, August 3, 2015 3:12 AM
    • Marked as answer by George123345 Friday, August 7, 2015 9:32 AM
    Sunday, August 2, 2015 8:28 PM

All replies

  • 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


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Proposed as answer by George123345 Friday, July 31, 2015 1:54 AM
    Thursday, July 30, 2015 12:21 AM
  • 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).


    Cindy Meister, VSTO/Word MVP, my blog

    • Proposed as answer by George123345 Friday, July 31, 2015 1:54 AM
    • Marked as answer by George123345 Friday, August 7, 2015 9:32 AM
    Thursday, July 30, 2015 4:40 PM
  • You can quickly apply the Normal style to a selection of cells by pressing Ctrl+Shift+N which is a default shortcut. You can also assign your own shortcut, as Cindy has already explained.


    Stefan Blom, Microsoft Word MVP

    • Proposed as answer by Charles Kenyon Monday, August 3, 2015 3:12 AM
    • Marked as answer by George123345 Friday, August 7, 2015 9:32 AM
    Sunday, August 2, 2015 8:28 PM