How do I get rid of "Normal" style in tables ?

B

Backen

I have created a template and don't use "Normal" style anywhere in the
template. When users create a document (from that tamplate) and then create
an table in the document, the table use some table style ("Tabellrutnät" in
swedish). If we position us in the start of the table and press enter, we get
a new paragraph before the table. That paragraph have the "Normal" style.

Why, and how can i get rid of it ?
No style using in the template should be "Normal" or based on "Normal".
I realy want to get rid of all the "Normal" style in the template.

/Anders Back
 
L

Lene Fredborg

If you insert a table in the start of a document and press Enter while the
insertion point is in the start of the first table cell, Word executes the
Table > Split Table command. That command always inserts a paragraph with the
style Normal.

I think the only way to change this is to use a macro. In order for the
macro to run instead of the built-in Split Table command, the macro must be
named "TableSplit". You can store the macro in the template. If you want the
macro to run in all documents regardless of the attached template, you could
store it in a global add-in - however, in that case you will need error
handling if you use a custom style name since that style may not exist in all
documents.

Below you will find such macro. The macro first executes the Split Table -
this leaves the insertion point in the new paragraphs that has bee inserted -
then the macro changes the style of that new paragraph. Replace "MyStyleName"
by the relevant style name.

Sub TableSplit()
With Selection
.SplitTable
'Insertion point now in new paragraph
'Replace "MyStyleName" below by the desired style name
.Style = "MyStyleName"
End With
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top