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
Helmut Weber - 22 Feb 2007 14:27 GMT
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

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"