![]() |
#1 |
Feedbooks.com Co-Founder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
|
Word Macro: Footnotes to inline text ?
I know that we've got some level 100 Word ninjas on this forum, with far better macro skills than I have (I haven't mastered this ninja art in its most basic form yet).
A common thing that I need to do while pre-processing e-books is to transform footnotes into inline text. A footnote in Word is actually separated into 2 different things:
Any one with enough Word macro ninja skills to help me on this one ? I really need to level up, but I'm kinda stuck with this one ![]() |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Hi Hadrien,
Try this, see code comments proceeded with ' for descriptions =X= Code:
Dim oFeets As Footnotes Dim oFoot As Footnote Dim oRange As Range Dim szFootNoteText As String ' Grabs the collection of FootNotes Set oFeets = Word.ActiveDocument.Footnotes ' Iterates through each footnote For Each oFoot In oFeets 'See the footnote text MsgBox oFoot.Range.Text szFootNoteText = oFoot.Range.Text 'Start search from beginning of document Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting With Selection.Find .Text = "^f" ' Looks for all footnotes .Forward = True .Wrap = wdFindStop End With Selection.Find.Execute ' Delete the footnote oFoot.Delete 'Insert the footnote text 'Here you do whatever format tickles your fancy Selection.Text = "<" + szFootNoteText + ">" Selection.InsertParagraphBefore Selection.InsertParagraphAfter Selection.Font.Bold = wdToggle Next Last edited by =X=; 09-05-2008 at 04:22 PM. Reason: Fixed typos |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Feedbooks.com Co-Founder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
|
Thanks, it seems to be working very well. So basically while the footnote marks (^f) can be found like a paragraph (^p), the footnotes themselves are a style for Word ? That's the main reason why I couldn't find a way to do this....
|
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
|
Quote:
What was weird is that Footnotes seem to be tables, so to get the text one had to use the Range object to get the textual information. =X= |
|
![]() |
![]() |
![]() |
#5 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Why do you want to convert footnotes into inline text? Isn't it better to have them as endnotes in an eBook? That's what I always do myself.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
zeldinha zippy zeldissima
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
Quote:
luckily, epub will be able to support TRUE footnotes, at the foot of the page, despite the reflowable text. won't THAT be nice. |
|
![]() |
![]() |
![]() |
#7 | |
Feedbooks.com Co-Founder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
|
Quote:
The good part is that I won't have to manually process all the files. Since I've marked them correctly as footnotes (and not just a link to an anchor), I can process them the way that I want. |
|
![]() |
![]() |
![]() |
#8 | |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
In the case of this particular book, by the way, even in the printed book the notes are endnotes, not footnotes. If you have a few words, a footnote is fine, but if you have a page of explanatory text, an endnote works a lot better. |
|
![]() |
![]() |
![]() |
#9 | |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 | |
Feedbooks.com Co-Founder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 |
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Even better!
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
And could you also add a back link from the footnote to the place in the text it refer to. That is something I really miss in paper books and an obvious thing to have in an ebook.
|
![]() |
![]() |
![]() |
#13 |
Feedbooks.com Co-Founder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
|
Sure, should be very easy in Mobipocket & PDF, probably a little more difficult in ePub with the multiple flows, but possible anyway.
|
![]() |
![]() |
![]() |
#14 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,395
Karma: 1358132
Join Date: Nov 2007
Location: UK
Device: Palm TX, CyBook Gen3
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#15 | |
Feedbooks.com Co-Founder
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,263
Karma: 145123
Join Date: Nov 2006
Location: Paris, France
Device: Sony PRS-t-1/350/300/500/505/600/700, Nexus S, iPad
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Formatting Macro (Stingo's Macro) | Stingo | Sony Reader | 75 | 08-24-2010 05:18 AM |
inline page markers overtop of text?? | Stinger | Kobo Reader | 9 | 05-28-2010 05:42 PM |
Calibre email inline text? | squawker | Calibre | 2 | 05-26-2010 06:17 PM |
need vba/word scripting help to turn inline text into header | Bierkonig | Workshop | 3 | 01-09-2009 09:40 PM |
Reformatting untidy text files macro | 46137 | Workshop | 8 | 05-02-2008 09:27 PM |