MsgBox showing all multiline-footnotes that erroneously have a carriage return at the end of lines

A

andreas

Can I tell Word via VBA to show me all the footnotes that erroneously
have a carriage return at the end of multi-line footnotes. ?
To be more specific there are still people who press enter at the end
of a written line instead of let Word do the line break
automatically.

The MsgBox should say for example:

Footnote 1: carriage return, page 7
Footnote 2: carriage return, page 9
etc.

Could please somebody give me a hint ? Thank you very much in
advance.

Regards,

Andreas
 
H

Helmut Weber

Hi Andreas,

like this:

Sub Macro4()
Dim strA As String
Dim strB As String
Dim oFtn As Footnote
For Each oFtn In ActiveDocument.Footnotes
If InStr(oFtn.Range.Text, Chr(13)) > 0 Then
strA = CStr(oFtn.index)
strA = "Footnote " & strA & " on page "
strB = oFtn.Range.Information(wdActiveEndPageNumber)
MsgBox strA & strB
End If
Next
End Sub

How to build the string that the messagebox shows,
is a matter of taste and style.

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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