Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

finding footnote-ending paragraph mark

10 views
Skip to first unread message

Peter T. Daniels

unread,
Nov 29, 2009, 9:12:06 AM11/29/09
to
I've just received a ms. from an author who ended every one of
hundreds of footnotes with Enter, which results in what looks on
screen like a sequence of paragraph marks -- the Enter plus the end-of-
footnote mark -- but ^p^p doesn't find them.

(I can't just delete all paragraph marks, because of multi-paragraph
footnotes.)

Graham Mayor

unread,
Nov 29, 2009, 9:47:11 AM11/29/09
to
Try ^13 in place of ^p

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org

Peter T. Daniels

unread,
Nov 29, 2009, 12:17:06 PM11/29/09
to
^13^13 found the sequence ok, but I couldn't find something to put in
the Replace box that worked.

(^13)(^13) Replace with \2 and Use Wildcards didn't do anything,
either.

On Nov 29, 9:47 am, "Graham Mayor" <gma...@REMOVETHISmvps.org> wrote:
> Try ^13 in place of ^p
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor -  Word MVP
>
> My web sitewww.gmayor.com

> Word MVP web sitehttp://word.mvps.org


> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
> Peter T. Daniels wrote:
> > I've just received a ms. from an author who ended every one of
> > hundreds of footnotes with Enter, which results in what looks on
> > screen like a sequence of paragraph marks -- the Enter plus the
> > end-of- footnote mark -- but ^p^p doesn't find them.
>
> > (I can't just delete all paragraph marks, because of multi-paragraph

> > footnotes.)- Hide quoted text -
>
> - Show quoted text -

Suzanne S. Barnhill

unread,
Nov 29, 2009, 1:16:20 PM11/29/09
to
Can you not replace with ^p?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Peter T. Daniels" <gram...@verizon.net> wrote in message
news:796ffdab-1d1b-471a...@m20g2000vbp.googlegroups.com...

Peter T. Daniels

unread,
Nov 29, 2009, 1:47:01 PM11/29/09
to
Nope; it's easy to Find the sequence -- ^13^13 and (^13)(^13)
Wildcards both work -- but Replace with any of ^13, ^p, or \2 does
nothing but send the cursor back to where it was when I clicked Find.

On Nov 29, 1:16 pm, "Suzanne S. Barnhill" <sbarnh...@mvps.org> wrote:
> Can you not replace with ^p?
>
> --
> Suzanne S. Barnhill
> Microsoft MVP (Word)
> Words into Type
> Fairhope, Alabama USAhttp://word.mvps.org
>

> "Peter T. Daniels" <gramma...@verizon.net> wrote in messagenews:796ffdab-1d1b-471a...@m20g2000vbp.googlegroups.com...

Suzanne S. Barnhill

unread,
Nov 29, 2009, 3:20:04 PM11/29/09
to
I guess I meant if you're not using wildcards (you don't have to be to use
^13). But Word can be extremely bloody-minded about paragraph marks
sometimes--in footnotes, between tables, etc. While it may be possible to
write a macro to take care of this (though ISTR that even a macro wouldn't
do it for paragraph breaks between tables), in the long run you may just
have to go through and do this by hand (using Delete or Backspace, whichever
works).

If all else fails (oh, joy!), you may have to copy the text of an existing
footnote (without the paragraph marks), delete the footnote reference in the
document body, insert a new footnote, and paste the copied content into it.
Lather. Rinse. Repeat.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type

Fairhope, Alabama USA
http://word.mvps.org

"Peter T. Daniels" <gram...@verizon.net> wrote in message

news:e3ab3c1b-3cd2-42a9...@n35g2000yqm.googlegroups.com...

Peter T. Daniels

unread,
Nov 29, 2009, 6:11:00 PM11/29/09
to
Oh well, thanks.

Maybe authors should have to have graduate students type their papers
again, who know how to use these things.

On Nov 29, 3:20 pm, "Suzanne S. Barnhill" <sbarnh...@mvps.org> wrote:
> I guess I meant if you're not using wildcards (you don't have to be to use
> ^13). But Word can be extremely bloody-minded about paragraph marks
> sometimes--in footnotes, between tables, etc. While it may be possible to
> write a macro to take care of this (though ISTR that even a macro wouldn't
> do it for paragraph breaks between tables), in the long run you may just
> have to go through and do this by hand (using Delete or Backspace, whichever
> works).
>
> If all else fails (oh, joy!), you may have to copy the text of an existing
> footnote (without the paragraph marks), delete the footnote reference in the
> document body, insert a new footnote, and paste the copied content into it.
> Lather. Rinse. Repeat.
>
> --
> Suzanne S. Barnhill
> Microsoft MVP (Word)
> Words into Type

> Fairhope, Alabama USAhttp://word.mvps.org
>
> "Peter T. Daniels" <gramma...@verizon.net> wrote in messagenews:e3ab3c1b-3cd2-42a9...@n35g2000yqm.googlegroups.com...

> > > > footnotes.)--

Suzanne S. Barnhill

unread,
Nov 29, 2009, 7:30:49 PM11/29/09
to
Hey, you've *seen* posts from graduate students in this NG. What makes you
think they know how to use Word any better than their professors?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type

Fairhope, Alabama USA
http://word.mvps.org

"Peter T. Daniels" <gram...@verizon.net> wrote in message

news:719f494e-087e-4a23...@d21g2000yqn.googlegroups.com...

Greg Maxey

unread,
Nov 29, 2009, 7:39:43 PM11/29/09
to
Mr. Daniels,

You might be able to clean them up with the macro posted below. Very
limited testing (two section document with a few footnotes - each
footnote ended using the enter key once). If you decide to try this,
I suggest running it on a copy of the document first.

Sub ScratchMaco()
Dim oFN As Footnote
Dim i As Long
For Each oFN In ThisDocument.Footnotes
oFN.Range.Select
With Selection
.Collapse wdCollapseStart
.Expand Unit:=wdParagraph
.MoveStartUntil Cset:=vbCr
On Error Resume Next
.Delete
On Error GoTo 0
End With
'Add to clean up a spurious space added at the end of the footnotes as
they were processed.
If oFN.Index <> ThisDocument.Footnotes.Count Then
oFN.Range.Select
oFN.Range.Characters.Last = "@"
oFN.Range.Characters.Last.Delete
End If
Next
End Sub

> > > > > footnotes.)--- Hide quoted text -

Peter T. Daniels

unread,
Nov 29, 2009, 11:19:35 PM11/29/09
to
They've been doing it since elementary school? Maybe even had classes!

On Nov 29, 7:30 pm, "Suzanne S. Barnhill" <sbarnh...@mvps.org> wrote:
> Hey, you've *seen* posts from graduate students in this NG. What makes you
> think they know how to use Word any better than their professors?
>
> --
> Suzanne S. Barnhill
> Microsoft MVP (Word)
> Words into Type

> Fairhope, Alabama USAhttp://word.mvps.org
>
> "Peter T. Daniels" <gramma...@verizon.net> wrote in messagenews:719f494e-087e-4a23...@d21g2000yqn.googlegroups.com...

> > > > > footnotes.)---

Peter T. Daniels

unread,
Nov 29, 2009, 11:28:33 PM11/29/09
to
I tried it, thank you, got it as far as a QAT button, but with the
cursor either at the beginning of the file or at the beginning of the
footnotes, I clicked the button and nothing happened at all!

Suzanne S. Barnhill

unread,
Nov 29, 2009, 11:46:08 PM11/29/09
to

That doesn't mean they are any better at it than the general run of users,
though. You'd be amazed how many people use Word all the time with no real
idea how to use it correctly (including almost everyone at Microsoft,
apparently).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type

Fairhope, Alabama USA
http://word.mvps.org

"Peter T. Daniels" <gram...@verizon.net> wrote in message

news:e475216f-7ff6-4fa2...@1g2000vbm.googlegroups.com...

Yves Dhondt

unread,
Nov 30, 2009, 7:25:51 AM11/30/09
to
The end of footnote paragraph marker is not an ordinary paragraph marker. It
can not be removed. That probably explains why a simple find/replace doesn't
work.

Try the following macro:

=============================
Sub RemoveEmptyParagraphsAtFootnoteEnd()
Dim note As Footnote

For Each note In ActiveDocument.Footnotes
note.Range.Select
Selection.Collapse wdCollapseEnd
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend

While (Selection.Text = vbCr)
Selection.Delete
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Wend
Next
End Sub
=============================

Yves

A simple search won't work due to the way a footnote is specified. Each
footnote has to reside in its own paragraph


"Peter T. Daniels" <gram...@verizon.net> wrote in message

news:00edb1fe-1661-4dfa...@j14g2000yqm.googlegroups.com...

Greg Maxey

unread,
Nov 30, 2009, 7:40:22 AM11/30/09
to
Mr. Daniels,

That is probably my fault as I used "ThisDocument" vice "ActiveDocument" in
the code. You most likely placed the macro in a template before pinning it
to the QAT. Changing ThisDocument to ActiveDoucment should work (it does
here) but the code was clunky to begin with. Try this instead:

Sub ScratchMaco()
Dim oFN As Footnote
Dim i As Long

For Each oFN In ActiveDocument.Footnotes
On Error Resume Next
Do While Asc(oFN.Range.Characters.Last) = 13
oFN.Range.Characters.Last.Delete
On Error GoTo 0
Loop
Next
End Sub

Greg Maxey

unread,
Nov 30, 2009, 8:07:42 AM11/30/09
to
Yves,

<The end of footnote paragraph marker is not an ordinary paragraph marker.
It can not be removed. That probably explains why a simple
<find/replace doesn't work.

I think you are right. The behaviour of that little mark is certainly
interesting it throws a RTE 5252 if you try to delete it with VBA and it
can't even be deleted manually! That was what led to the On Error
statement in my two earlier versions. After seeing your version, I went
back to check and discovered that the mark itselt does not appear to be
physically part of the footnote range so there is no need for the error
handler or to manipulate the selection.


Sub ScratchMaco()
Dim oFN As Footnote

For Each oFN In ActiveDocument.Footnotes

Do While Asc(oFN.Range.Characters.Last) = 13
oFN.Range.Characters.Last.Delete

Loop
Next
End Sub

Peter T. Daniels

unread,
Nov 30, 2009, 10:05:48 AM11/30/09
to
Well ... Yves posted his macro a few minutes before Mr. Maxey posted
the first of his revisions, so I tried Yves's, and it worked, and I
could watch it working -- page after page flashed by, with highlighted
footnotes. It didn't disturb the paragraph divisions within footnotes
-- yet in the code I don't see a reference to paragraph marks (as I do
see in Mr. Maxey's).

The macro did end up in the normal.dotm template; is there a way to
put a macro only into a document and not into any template at all?

Also, if I don't give it a button in the QAT, I don't know how to run
a macro. (*Word2007 Inside Out* indicates, p. 813, that doing it some
other way is clunky or inefficient anyway.)

On Nov 30, 8:07 am, "Greg Maxey"

> > "Peter T. Daniels" <gramma...@verizon.net> wrote in message


> >news:00edb1fe-1661-4dfa...@j14g2000yqm.googlegroups.com...
> >> I've just received a ms. from an author who ended every one of
> >> hundreds of footnotes with Enter, which results in what looks on
> >> screen like a sequence of paragraph marks -- the Enter plus the
> >> end-of- footnote mark -- but ^p^p doesn't find them.
>
> >> (I can't just delete all paragraph marks, because of multi-paragraph

> >> footnotes.)-

Yves Dhondt

unread,
Nov 30, 2009, 10:23:31 AM11/30/09
to

The macro isn't the finest piece of code ever written. vbCr (carriage
return) is ^13 and your paragraph marker.

You can access macros from the Developer tab. If you hit the Macro button on
that tab, a list of available macros appear. You can use the "Run" button to
run any of those.

You can add the Macro button (View Macro) to your QAT. Or you can simply
press ALT+F8 (the default shortcut) to make the dialog appear.

Yves

"Peter T. Daniels" <gram...@verizon.net> wrote in message

news:d9e215bf-40c2-4ecc...@e20g2000vbb.googlegroups.com...

Yves Dhondt

unread,
Nov 30, 2009, 10:24:31 AM11/30/09
to

I did some checking in the open xml specification. It seems that the content
of a footnote or endnote has to be one or more block-level elements (such as
paragraphs, tables, ...) or an element containing one or more block level
elements. So it is not possible to define a footnote or endnote as a simple
run of text, there has to be a 'hard' separator at the end. I'm guessing
that is why Word is treating the marker as a special case not to be messed
with.

It also explains why it is not possible to have multiple footnotes on the
same line in Word. (I'm aware of the workaround using hidden text for the
'paragraph' marker.)

Yves

"Greg Maxey" <gma...@mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> wrote in message
news:OhmRa4b...@TK2MSFTNGP05.phx.gbl...

Greg Maxey

unread,
Nov 30, 2009, 10:28:33 AM11/30/09
to
Yes he did and it works perfectly well. The reason you can watch it working
is because Yves used the selection object vice the range object. Using
selection your screen is being refreshed with each selection change The
penalty, if you want to call it that, for using the selection object over
the range object is the speed the macro will run. In many cases the speed
advantage is mute but could become significant with larger numbers of
footnotes.

Yves reference to paragraph marks is vbCr. vbCr is one of the miscellaneous
contants that the VB editor can using in place of the equivelent Chr(13).
Open your VB Editor (Alt+F11), highlight the intance of vbCr in Yves' code
and press F1. You should see the help file open with a listing of the
miscellaneous constants.

> The macro did end up in the normal.dotm template; is there a way to put a
> macro only into a document and not into any template at all?

Yes. With the document open, open the VB Editor. If not displayed, display
the Project Explorer (Ctrl+r). Expand the tree for the document project and
paste the code into the ThisDocument class module. When I was working of
the first edition, I was working in the VB Editor ThisDocument class module
and ran the macro by pressing the run command on the VBE toolbar (looks like
a play button on a DVD player). I do that a lot. That is why I neglected to
change ThisDocument to ActiveDocument before posting.

You can also run code using the Developer Tab>Code>Macros. Select the
appropriate document from the "Macros in" drop down. Select the macro and
press Run.

Suzanne S. Barnhill

unread,
Nov 30, 2009, 10:29:08 AM11/30/09
to
To run a macro that's not on the QAT, click Macros on the View tab, then
View Macros. This opens the classic Macros dialog. Select your macro and
click Run. You can save a macro in a document. If you use Graham's
installation method, just select the active document instead of "All active
templates and documents" in the Macros dialog before you click Create.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Peter T. Daniels" <gram...@verizon.net> wrote in message
news:d9e215bf-40c2-4ecc...@e20g2000vbb.googlegroups.com...

Peter T. Daniels

unread,
Nov 30, 2009, 1:19:48 PM11/30/09
to
On Nov 30, 10:24 am, "Yves Dhondt" <yves.dho...@gmail.com> wrote:

> It also explains why it is not possible to have multiple footnotes on the
> same line in Word. (I'm aware of the workaround using hidden text for the
> 'paragraph' marker.)

(But Word still leaves all the space that all the separate notes would
occupy, Suzanne has reported.)

It would be nice if that were fixed. In hot type books, it was very
usual to put two and three short reference footnotes on one line (a
column of such things under the left side of a text block looks quite
unbalanced). With large pages, it was quite common to have two columns
of footnotes under a single column of text -- that would be a nearly
adequate substitute for not being able to put several in one line.

Beth Melton

unread,
Nov 30, 2009, 1:19:41 PM11/30/09
to
It states, "As you may have found in the previous section, using the Macro
dialog box is not the most efficient way to run your macros. Ideally,
running a macro should be as simple as clicking a button or pressing a
keyboard shortcut."

Perhaps I should have indicated using the Macro dialog box isn't the most
efficient way to run macros you intend to use repeatedly. :-)

~Beth Melton
Microsoft Office MVP

"Peter T. Daniels" <gram...@verizon.net> wrote in message

news:d9e215bf-40c2-4ecc...@e20g2000vbb.googlegroups.com...

Peter T. Daniels

unread,
Nov 30, 2009, 1:37:40 PM11/30/09
to
(I scaned the previous section for instructions on running a macro
with a dialog box, but it was about recording macros. Maybe I didn't
go back far enough.)

On Nov 30, 1:19 pm, "Beth Melton" <bmel...@NoSpam4Memvps.org> wrote:
> It states, "As you may have found in the previous section, using the Macro
> dialog box is not the most efficient way to run your macros. Ideally,
> running a macro should be as simple as clicking a button or pressing a
> keyboard shortcut."
>
> Perhaps I should have indicated using the Macro dialog box isn't the most
> efficient way to run macros you intend to use repeatedly. :-)
>
> ~Beth Melton
> Microsoft Office MVP
>

> "Peter T. Daniels" <gramma...@verizon.net> wrote in messagenews:d9e215bf-40c2-4ecc...@e20g2000vbb.googlegroups.com...


>
>
>
> > Also, if I don't give it a button in the QAT, I don't know how to run
> > a macro. (*Word2007 Inside Out* indicates, p. 813, that doing it some

> > other way is clunky or inefficient anyway.)-

Beth Melton

unread,
Nov 30, 2009, 4:27:18 PM11/30/09
to
The Macro dialog box was mentioned in section on recording macros. Also, as
noted at the beginning of the chapter, it doesn't begin to encompass macros
and VBA and is intended for those who are beginners. I'd have loved to have
been able to add more on the subject but was already pushing the scope of
the intended audience by including a portion on editing.

~Beth Melton
Microsoft Office MVP

"Peter T. Daniels" <gram...@verizon.net> wrote in message
news:5f505743-9945-4f9b...@o13g2000vbl.googlegroups.com...

0 new messages