InsertFootnote ruins Table breaks

K

klam

I added this macro (from a reference article on this site) as I wanted to
add a TAB before the Footnote Text, that's all.

Sub InsertFootnote()

ActiveDocument.Footnotes.Add Range:=Selection.Range

With Selection
.Paragraphs(1).Range.Characters(2) = ""
.InsertAfter vbTab
.Collapse wdCollapseEnd
End With

End Sub

Then I noticed my Tables do not break where they should: many pages have
tables that end much before the page does, and some pages the Tables run
right through the footer and off the bottom of the page.

When I "rem'd" all the statements, my tables worked fine. So can someone pls
tell me what to change in this macro so it doesn't bugger up my page length
and it still puts a TAB btwn the Footnote Reference and Footnote Text?

TIA,
klam
 
D

DA

Hi Klam

From what you're describing it almost sounds like you
have the "Keep with next" and "Keep lines together"
pragraph format attribute turned on for your table
contents.

Select your table and turn off the above two settings and
your tables should flow normally.

Best of luck,
Dennis
 
K

klam

Hi Dennis,

Thx a mint for the suggestion. I already checked that and only have Keep
with Next on the first Header Row (repeating row). I have checked all the
other cells individually to ensure that Keep with Next, Widow/Orph, Keep
Lines Together are off, and Allow Row to Break is on.

The thing is when I edit out (make the macro lines all
Declarations/Comments), the tables break at the right place. I just cut and
paste the macro from the MVP reference off this site as I'm VBA-ignorant.

Can you (or anyone :) tell me what the original InsertFootnote macro
was...I think I have to change it back and manually edit all my footonotes.

TIA,
klam
 
K

klam

Sorry, I don't mean to confuse things...

I just tried it again...when I made the statements Declarations, it had no
effect. When I insert a footnote on the page, the table breaks as it should.
When I delete the footnote, the table reverts to its wrong state (leaves
half the page blank, i.e., doesn't break the row).

When I copy the table to a new document (same template) the tables break as
they should.

Any suggestions? I've been working on this problem for days and it's
driving me batty!

TIA,
klam
 
D

DA

Still sounds like the "Keep with next" is staying on or
getting switched on. Have you checked your styles to see
that it isn't enabled in there?

Also, when you get the tables breaking incorrectly,
rather than going through each cell individually, have
you tried to do a "select>all" on the document and then
setting the "Keep with next" and "Keep lines together" to
false?

Dennis.
 
K

klam

Hi Dennis,

Never thought of the Keep with Next being tied to my Styles. That wasn't
it, but it's a tip I am sure will prove useful in the future.

I usually don't check cell-by-cell either, but someone else on this board
mentioned it so I checked it out (when I'm desparate for a solution, I'll try
just about anything!).

I'd still like to figure this out so if you know how to strip the table
styles (I don't see a default option), that would be helpful. I want to try
to strip the tables of all formatting and see if that changes things. (I
tried selecting all the text and putting it all as Paragraph Body Text
Style...the problem remained.)

cheers,
klam
 

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