in reply to How to add a footnote in MS Word using win32::ole

I understand that your problem is that the footnote symbol (like superscript 1) is in the wrong place. I do not really know what the problem is, but when I manually type word documents I usually first type a space, then go one char left, add a footnote, and then continue typing after the space. This workaround seems to be ok for Perl as well. The following works for me:

#---------------------------------------- #Insert Footnote Here $selection->Move(-1); $selection->Footnotes->Add( $selection->{Range},"1", "This is the Firs +t Footnote"); $selection->Move(1);

Again, I do not really know why but you could encapsulate it into another subroutine.

Replies are listed 'Best First'.
Re^2: How to add a footnote in MS Word using win32::ole
by Adithyakiran.k (Novice) on Sep 12, 2013 at 11:59 UTC

    Thank you. This worked.

Re^2: How to add a footnote in MS Word using win32::ole
by Adithyakiran.k (Novice) on Nov 07, 2013 at 15:02 UTC

    Hi, Is there anyway to format the footnote text that is added to the Word doc?

    #---------------------------------------- #Insert Footnote Here $selection->Move(-1); $selection->Footnotes->Add( $selection->{Range},"1", "This is the <i>F +irst Footnote</i>"); $selection->Move(1);

    The text within the "i" tags should be in Italics Format in Footnote in word document.