M
marzolian
I sometimes need to use a macro to temporarily move footnotes from
their actual location. Here's the current version:
http://techlanguage.com/tips/MoveFootnotesToEnd.txt
The routine "MoveFootnotesToEnd" copies each footnote text into a
string array, sets a bookmark at the location of the footnote, and
deletes the footnote. It then moves to the very end of the document
and creates a table. Finally, it pastes each footnote into the table.
A second macro restores each footnote to its original position.
My problem is, this version strips all the formatting from each
footnote.
To fix it, my first thought was, instead storing the text in a string,
I could use some other variable type. In the assignment step, these
statements do put the proper value into the variable:
ReDim FootnoteText(Q) As Variant
Set FootnoteText(i) = Fnote.Range.FormattedText
However, I can't get VB to paste or type the formatted text into the
table cell. This statement was used to test the location:
Selection.Tables(1).Cell(i + 1, Q).Range.Text = "xxx"
xxx shows up in the correct table cell. But this step produces
nothing:
Selection.Tables(1).Cell(i + 1, Q).Range.FormattedText =
FootnoteText(i).FormattedText
The VB editor tells me that FootnoteText(i) = "" (empty string) when
it comes to this step.
Any suggestions? Thanks.
Steven Marzuola
(e-mail address removed)
(delete dashes and invalid)
their actual location. Here's the current version:
http://techlanguage.com/tips/MoveFootnotesToEnd.txt
The routine "MoveFootnotesToEnd" copies each footnote text into a
string array, sets a bookmark at the location of the footnote, and
deletes the footnote. It then moves to the very end of the document
and creates a table. Finally, it pastes each footnote into the table.
A second macro restores each footnote to its original position.
My problem is, this version strips all the formatting from each
footnote.
To fix it, my first thought was, instead storing the text in a string,
I could use some other variable type. In the assignment step, these
statements do put the proper value into the variable:
ReDim FootnoteText(Q) As Variant
Set FootnoteText(i) = Fnote.Range.FormattedText
However, I can't get VB to paste or type the formatted text into the
table cell. This statement was used to test the location:
Selection.Tables(1).Cell(i + 1, Q).Range.Text = "xxx"
xxx shows up in the correct table cell. But this step produces
nothing:
Selection.Tables(1).Cell(i + 1, Q).Range.FormattedText =
FootnoteText(i).FormattedText
The VB editor tells me that FootnoteText(i) = "" (empty string) when
it comes to this step.
Any suggestions? Thanks.
Steven Marzuola
(e-mail address removed)
(delete dashes and invalid)