Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 02-10-2017, 06:29 PM   #1
egyblind
Junior Member
egyblind began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2017
Device: iphone
Question vba code for accessible books

hello sirs

i'm new member here, wish you help me
i'm visually impaired, so would like to modify some files to be more accessible for me and others,


first thing, need to convert all footnotes and endnotes in a word file into normal text only start by FN for footnote and EN for endnote.
also convert its reference number inside text to normal (#)
thanks very much for your support
egyblind is offline   Reply With Quote
Old 02-11-2017, 12:09 AM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Not sure exactly what you are looking for.
What do you mean by converting FN/EN to "normal" text or normal number? How is it formatted now and what is your definition of normal?
What software are you using? What format are your books currently?

Welcome to MR!
Turtle91 is offline   Reply With Quote
Old 02-11-2017, 01:04 AM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Turtle91 View Post
Not sure exactly what you are looking for.
What do you mean by converting FN/EN to "normal" text or normal number? How is it formatted now and what is your definition of normal?
@Turtle91: The OP most like wants to directly embed footnote and endnote definitions in the body text so that they're automatically read when s/he uses VoiceOver (TTS).

E.g. Instead of:

Quote:
This is a footnote[1] in the body text.
[1] an additional piece of information printed at the bottom of a page
s/he probably wants:

Quote:
This is a footnote (footnote 1: an additional piece of information printed at the bottom of a page) in the body text.
I'm pretty sure that this can be done with VBA, but I haven't used MS Word macros in ages. Also since macOS has TTS features built into OS there might be a non-standard iBooks epub3 extension that'll automatically retrieve footnote definitions or dedicated iOS apps for visually impaired readers that'll do this automatically.
Doitsu is offline   Reply With Quote
Old 02-11-2017, 03:17 AM   #4
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
This can be done with VBA, but I haven't worked with VBA for ages.
Toxaris is offline   Reply With Quote
Old 02-11-2017, 07:54 AM   #5
egyblind
Junior Member
egyblind began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2017
Device: iphone
Thumbs up vba macro for word

hello

yes i want to embed footnote and endnote definitions in the body text and put "fn" / "en" before the text to be known its footnote / endnote.

am using microsoftword file.doc
thanks
egyblind is offline   Reply With Quote
Old 02-11-2017, 08:25 AM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@egyblind:

It might be possible to create a Calibre plugin that'll embed footnote/endnote definitions in the body text. Maybe you could ask about it in the Calibre Plugin Ideas thread?

I've got a couple of additional questions:

1. Have you already created a couple of MS Word documents with footnote references in them that you want to convert or do you create these documents from scratch as needed?

2. What tool do you use to convert MS Word documents to epub books?

3. Did you investigate whether iBooks Author has any accessibility features that'll mark up footnote/endnote definitions so that they're automatically read by VoiceOver?
Doitsu is offline   Reply With Quote
Old 02-11-2017, 11:42 AM   #7
egyblind
Junior Member
egyblind began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2017
Device: iphone
Post word macro

hello Doitsu
i need to do this in word files .doc and .docx
and will read them on windows pc on ms-word

the documents i've contains footnotes and endnotes + other objects but i not like to write long topic for this asked about footnotes and endnootes only.
all i need vba macro for word.
thanks

Quote:
Originally Posted by Doitsu View Post
@egyblind:

It might be possible to create a Calibre plugin that'll embed footnote/endnote definitions in the body text. Maybe you could ask about it in the Calibre Plugin Ideas thread?

I've got a couple of additional questions:

1. Have you already created a couple of MS Word documents with footnote references in them that you want to convert or do you create these documents from scratch as needed?

2. What tool do you use to convert MS Word documents to epub books?

3. Did you investigate whether iBooks Author has any accessibility features that'll mark up footnote/endnote definitions so that they're automatically read by VoiceOver?
egyblind is offline   Reply With Quote
Old 02-11-2017, 02:18 PM   #8
elibrarian
Imperfect Perfectionist
elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.elibrarian ought to be getting tired of karma fortunes by now.
 
elibrarian's Avatar
 
Posts: 464
Karma: 724664
Join Date: Dec 2011
Location: Ølstykke, Denmark
Device: none
Quote:
Originally Posted by egyblind View Post
hello

yes i want to embed footnote and endnote definitions in the body text and put "fn" / "en" before the text to be known its footnote / endnote.
This should do it:

Code:
'---------------------------------------------------------------------------------------
' Method : Notes2Inline
' Author : Kim
' Date   : 11-02-2017
' Purpose: Convert footnotes/endnotes to inline text
'---------------------------------------------------------------------------------------
Sub Notes2Inline()

    Dim oFNs As Footnotes
    Dim oFN As Footnote
    Dim oENs As Endnotes
    Dim oEN As Endnote
    Dim oRng As Range
    Dim strFNText As String
    Dim strENText As String
    Dim lngIndex As Long 'variable for note number. If not wanted, remove _
    " & lngIndex & " (including qoutation marks) from the With oRng.Text lines below
     
    Set oFNs = Word.ActiveDocument.Footnotes
    For Each oFN In oFNs
        strFNText = oFN.Range.Text
        lngIndex = lngIndex + 1
        Set oRng = ActiveDocument.Range
        With oRng.Find
            .Text = "^f" ' Looks for all footnotes
            .Forward = True
            .Wrap = wdFindStop
            If .Execute Then
                oFN.Delete
                With oRng
                    .Text = " [Footnote " & lngIndex & ": " & strFNText & "]"
                    .Font.Color = wdColorDarkBlue 'Color text taken from endnotes blue
                End With
            End If
        End With
         'Uncomment to disable undo to save memory on very large documents.
         'ActiveDocument.UndoClear
    Next

    Set oENs = Word.ActiveDocument.Endnotes
    For Each oEN In oENs
        strENText = oEN.Range.Text
        lngIndex = lngIndex + 1
        Set oRng = ActiveDocument.Range
        With oRng.Find
            .Text = "^e" ' Looks for all endnotes
            .Forward = True
            .Wrap = wdFindStop
            If .Execute Then
                oEN.Delete
                With oRng
                    .Text = " [Endnote " & lngIndex & ": " & strENText & "]"
                    .Font.Color = wdColorDarkRed 'Color text taken from endnotes red
                End With
            End If
        End With
         'Uncomment next line to disable undo to save memory on very large documents.
         'ActiveDocument.UndoClear
    Next

End Sub
To be honest, I didn't forge the code myself, found it by a google search for "vba footnote to text" and modified it a little to cater for endnotes as well

Regards,

Kim
elibrarian is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Store Code etc for technical books skorasaurus Library Management 5 12-29-2016 06:03 PM
84 percent of top 1,000 titles available as accessible e-books, study finds Alexander Turcic News 5 08-31-2013 11:27 PM
Books on Board 40% off code artifact Deals and Resources (No Self-Promotion or Affiliate Links) 1 11-20-2012 02:38 AM
Where do YOU store the code that goes with technical books? technomom Library Management 10 03-25-2011 03:38 PM
need vba/word scripting help to turn inline text into header Bierkonig Workshop 3 01-09-2009 09:40 PM


All times are GMT -4. The time now is 05:57 AM.


MobileRead.com is a privately owned, operated and funded community.