Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 07-12-2017, 07:35 PM
macropod's Avatar
macropod macropod is offline How to change superscript footnotes into genuine Word footnotes Windows 7 64bit How to change superscript footnotes into genuine Word footnotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


Quote:
Originally Posted by iwonder View Post
But when notes are disseminated (scattered?) in the text (as they are in my converted files), i have to select them with the Ctrl key, and in that case, i found that it doesn't work
With footnotes, you can only process them on one page at a time (i.e. you can't select them across multiple pages) and you have to select the footnotes concerned for processing.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 07-14-2017, 01:13 PM
iwonder iwonder is offline How to change superscript footnotes into genuine Word footnotes Windows 10 How to change superscript footnotes into genuine Word footnotes Office 2013
Novice
 
Join Date: Jun 2017
Location: France
Posts: 10
iwonder is on a distinguished road
Default

Having spent a lot of time on your code, I'm 99% sure that a punctuation mark must precede the footnote calling number to make it correctly work.

"This is a sentence.1 This"
will work

"This is a word1 followed by the rest of the sentence."
will not work

I read many English text where the footnote calling number is located at the end of a sentence, just after the period. Maybe this is a rule of thumb in English typography. (Is it ?)
But in my native language, it is not ; footnote calling numbers can be anywhere in a sentence.
Reply With Quote
  #18  
Old 07-14-2017, 04:03 PM
macropod's Avatar
macropod macropod is offline How to change superscript footnotes into genuine Word footnotes Windows 7 64bit How to change superscript footnotes into genuine Word footnotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You're wrong about that - nothing in the code requires a preceding punctuation mark. Moreover, my code has nothing to do with typography conventions re footnote reference placement. It does not affect the footnote reference placement, so don't go blaming my code for what you consider a violation of a typography convention when the issue concerns the data you're processing. FWIW, the US convention (as is often the case) differs from the rest of the world. IIRC, I have posted code in other threads/forums for altering the footnote reference placement - but only insofar as whether the footnote reference occurs before or after a punctuation mark.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #19  
Old 07-14-2017, 04:43 PM
iwonder iwonder is offline How to change superscript footnotes into genuine Word footnotes Windows 10 How to change superscript footnotes into genuine Word footnotes Office 2013
Novice
 
Join Date: Jun 2017
Location: France
Posts: 10
iwonder is on a distinguished road
Default

Where did you see I was blaming your code ???????
I never wrote such a thing, moreover I never thought such a thing !

I'm always respectful with people sharing gtheir knowledge and developping skills.

Who wrote about violation of typography convention ? Not me... I just ask a question...
I don't understand why such a reaction...


Quote:
Originally Posted by macropod View Post
My code has nothing to do with typography conventions re footnote reference placement. It does not affect the footnote reference placement, so don't go blaming my code for what you consider a violation of a typography convention when the issue concerns the data you're processing. FWIW, the US convention (as is often the case) differs from the rest of the world. IIRC, I have posted code in other threads/forums for altering the footnote reference placement - but only insofar as whether the footnote reference occurs before or after a punctuation mark.
Reply With Quote
  #20  
Old 07-15-2017, 05:09 AM
macropod's Avatar
macropod macropod is offline How to change superscript footnotes into genuine Word footnotes Windows 7 64bit How to change superscript footnotes into genuine Word footnotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Well, it was you who wrote:
Quote:
Originally Posted by iwonder View Post
Having spent a lot of time on your code, I'm 99% sure that a punctuation mark must precede the footnote calling number to make it correctly work.
And that complaint has nothing to do with my code. Accordingly, it can only be understood as an unwarranted criticism or a complete irrelevance. You choose.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #21  
Old 09-20-2019, 12:37 PM
toddreitzel toddreitzel is offline How to change superscript footnotes into genuine Word footnotes Windows 10 How to change superscript footnotes into genuine Word footnotes Office 2016
Novice
 
Join Date: Sep 2019
Posts: 6
toddreitzel is on a distinguished road
Default

I tried this macro. I pasted it in exactly as provided except, because my footnote numbers aren't bracketed or enclosed by anything else, I changed:
.Text = "\[([0-9]{1,})\]"
to:
.Text = "([0-9]{1,})"

I also selected a group of footnotes at the bottom of a page. When I ran the macro, I got the same error message:
Run-time error '13': Type mismatch

I then clicked "debug" and it highlighted the following line in yellow: k = .Paragraphs(1).Range.Words(1) - 1

Did I do something wrong? Any advice what to try next?
Reply With Quote
  #22  
Old 09-20-2019, 03:15 PM
macropod's Avatar
macropod macropod is offline How to change superscript footnotes into genuine Word footnotes Windows 7 64bit How to change superscript footnotes into genuine Word footnotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If neither your footnote references in the body, nor your footnote references in the footnotes are bracketed, you need to change both:
.Text = "\[([0-9]{1,})\]"
and:
.Text = "[" & i & "]"
to suit, as per the comments in the code.

That said, if you did the same as the original poster who reported the "Run-time error '13': Type mismatch" error did, it's not surprising you're getting the same error.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #23  
Old 09-23-2019, 12:20 AM
KimJongUndo KimJongUndo is offline How to change superscript footnotes into genuine Word footnotes Mac OS X How to change superscript footnotes into genuine Word footnotes Office 2019
Novice
 
Join Date: Sep 2019
Posts: 4
KimJongUndo is on a distinguished road
Default Type 13 error

A key feature of this macro is that it only requires you to select the actual text of the footnote. At first blush, I thought it was necessary to include the body of the text in which the footnotes occur BUT that is not the case. I too was getting a type 13 error but I figured out it was because I was misunderstanding how convenient the macro is.

In the example document:
If you select the following text (which you might do if you thought the macro required the text of the footnote to be selected along with the footnote):
"This is a sentence."1 This is a sentence. This is a sentence.2
This is a new paragraph. This is a sentence.3 This is a sentence.4 This is a sentence.
1 This is a footnote.
2 This is a footnote.
3 This is a footnote.
4 This is a footnote.


You will get a type 13 error every time.

That's because the macro actually uses the fact that the text of the footnote always begins with a number. But body text doesn't follow that convention.
So the correct selection is:
“This is a sentence.”1 This is a sentence. This is a sentence.2
This is a new paragraph. This is a sentence.3 This is a sentence.4 This is a sentence.
1 This is a footnote.
2 This is a footnote.
3 This is a footnote.
4 This is a footnote.


This is a well-written and simple macro.
Reply With Quote
  #24  
Old 09-23-2019, 12:42 AM
KimJongUndo KimJongUndo is offline How to change superscript footnotes into genuine Word footnotes Mac OS X How to change superscript footnotes into genuine Word footnotes Office 2019
Novice
 
Join Date: Sep 2019
Posts: 4
KimJongUndo is on a distinguished road
Default Potential Other Error & Solution

I ran into an error that I had not seen before:

"Run-time error: '5941'

The document I'm working with had been converted from pdf to word and somehow, along the way (I presume it wasn't a conscious decision), what should have been superscripted characters (such as footnotes) where in fact actually only raised.

My jaw hit the floor as I realized the macro wouldn't work because, despite having upwards of 850 footnotes, the document did not contain a single superscript. Yet, I was staring at what looked like superscript on my screen. It was only through closer inspection of the font dialog box that I realized this wasn't word doing something completely idiosyncratic. And thankfully there's a solution.

The solution: advanced find & replace. Replacing raised text with the same text but not-raised and superscripted instead took care of the problem in short order. The find text will find any number and the replace text will replace it with itself. So the footnote number will be unharmed. The only difference is exactly what we want the formatting of those numbers to be.
Find: ([0-9]{1,})
Replace: \1
Advanced formatting described below:
IT IS CRUCIAL that "use wildcards" is checked, and that you go into the font formatting dialog for find (accomplish this by clicking into the find field and then altering the formatting stuff at the bottom of the advanced find & replace dialog box). In the font formatting, under the "advanced" tab, change the "Position" field from "normal" to "raised". You also have to enter a value for the amount the text is raised. This was not something my pdf converter had been consistent about but I found that most of my footnotes had been raised 3.5, 4, and 4.5 pts. I fully expect that I will have to run this find & replace a few more times when the macro breaks again because the footnotes were raised by some other amount—at least I now know where to look for that number!

It is also crucial that the replace text have the position "normal" and the superscript box checked (under the font tab within font formatting). In my case, the footnote text had not only been raised instead of superscripted but it was hilarious font sizes such as 5 pt instead of the size of the body text (11pt) so I made that change in the replace font formatting as well.
Reply With Quote
  #25  
Old 09-23-2019, 09:22 AM
toddreitzel toddreitzel is offline How to change superscript footnotes into genuine Word footnotes Windows 10 How to change superscript footnotes into genuine Word footnotes Office 2016
Novice
 
Join Date: Sep 2019
Posts: 6
toddreitzel is on a distinguished road
Default

(@KimJongUndo: I am selecting only the footnote text.)

@macropod:
Thank you. I changed both:
.Text = "\[([0-9]{1,})\]"
to:
.Text = "([0-9]{1,})"
and
.Text = "[" & i & "]"
to
.Text = i
But I still got the Run-time error '13': Type mismatch, with debugging highlighting in yellow: k = .Paragraphs(1).Range.Words(1) - 1

So I ran the advanced find and replace recommended by KimJongUndo and converted all nonsuperscript raised footnote callout numbers to nonraised superscripts (which yielded a lot of changes).

Then reran the macro (still with the 2 above edits), and still got the same error with same line highlighted by debugger.

I'm not an expert in macros. Did I do the edits correctly?
Reply With Quote
  #26  
Old 09-23-2019, 09:55 AM
KimJongUndo KimJongUndo is offline How to change superscript footnotes into genuine Word footnotes Mac OS X How to change superscript footnotes into genuine Word footnotes Office 2019
Novice
 
Join Date: Sep 2019
Posts: 4
KimJongUndo is on a distinguished road
Default

The other reason a type 13 error might happen is that you've got a paragraph return in your footnote where there shouldn't be one. It's one of those characters that's only visible if you show non-printing characters. You can show non-printing characters by hitting ctrl+shit+8. Now you should see dots for every space, an arrow for manual line breaks, and the paragraph mark at the end of every paragraph.

For example:

1 some footnote text.¶
2 some more other footnote text.¶


The macro can parse the above perfectly. BUT, it will fail to parse this:

1 some footnote text.¶
2 some more¶
other footnote text.¶


That's because it will see that second ¶ mark and think that's the end of footnote 2 and will then think the next paragraph (in the example, "other footnote text.¶") is a third footnote. The reason the macro fails is because it's expecting footnotes to begin with numbers. Since the third paragraph doesn't begin with a number, there's a type mismatch.

The solution:
Hit ctrl+shift+8 to show non-printing characters and change that second ¶ (and any others like it) to a manual line break. Hit shift+enter to create a manual line break. Lines broken up with line breaks are still part of the same paragraph to word, which is why the macro will work again because now it doesn't think the third line is another footnote.
Reply With Quote
  #27  
Old 09-23-2019, 10:36 AM
toddreitzel toddreitzel is offline How to change superscript footnotes into genuine Word footnotes Windows 10 How to change superscript footnotes into genuine Word footnotes Office 2016
Novice
 
Join Date: Sep 2019
Posts: 6
toddreitzel is on a distinguished road
Default

Thank you, I did find some carriage returns within footnotes. I deleted those and reran the macro as above and still got the same error message.
Reply With Quote
  #28  
Old 09-23-2019, 03:19 PM
KimJongUndo KimJongUndo is offline How to change superscript footnotes into genuine Word footnotes Mac OS X How to change superscript footnotes into genuine Word footnotes Office 2019
Novice
 
Join Date: Sep 2019
Posts: 4
KimJongUndo is on a distinguished road
Default

The only other way that I can think of a type 13 error would occur is if you've got anything other than a space after your footnote number in the footnote text.

For example:
1 adhidnads in asdifnidsfn

Will work well but:
1] asdnin idsne i sdf
or
1A. Schwarzenegger asdinvie dinsve
will create a type 13 error.

The macro does provide for ways of removing standard formatting (such as going from [1] -> 1) but my pdf conversion isn't consistent about spacing so I've had a situation where the space after the footnote number disappeared and it threw everything off. Might that be what's happening to you?
Reply With Quote
  #29  
Old 09-23-2019, 03:28 PM
macropod's Avatar
macropod macropod is offline How to change superscript footnotes into genuine Word footnotes Windows 7 64bit How to change superscript footnotes into genuine Word footnotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by KimJongUndo View Post
I ran into an error that I had not seen before:

"Run-time error: '5941'

The document I'm working with had been converted from pdf to word and somehow, along the way (I presume it wasn't a conscious decision), what should have been superscripted characters (such as footnotes) where in fact actually only raised.

My jaw hit the floor as I realized the macro wouldn't work because, despite having upwards of 850 footnotes, the document did not contain a single superscript.
The difference between superscript and raised characters would be pretty obvious though. And your Find/Replace 'fix' is more complicated than it need be. Try:
Find = ^#
with the find font set to the appropriate raised value, and
Replace = ^&
with the replacement font set to superscript and normal (not raised). Wildcards not needed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #30  
Old 09-23-2019, 03:43 PM
macropod's Avatar
macropod macropod is offline How to change superscript footnotes into genuine Word footnotes Windows 7 64bit How to change superscript footnotes into genuine Word footnotes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by toddreitzel View Post
Thank you, I did find some carriage returns within footnotes. I deleted those and reran the macro as above and still got the same error message.
Do you have a space character after each footnote reference in the document body? As the notes in post 2 indicate, that is a requirement.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change superscript footnotes into genuine Word footnotes Word footnotes and track changes problem Carnegie Word 14 03-13-2017 01:31 AM
Convert manual cross references in footnotes to other footnotes to automatic cross references ghumdinger Word VBA 7 11-20-2014 11:47 PM
How to change superscript footnotes into genuine Word footnotes word 2007 - footnotes and text box glggluig Word 1 08-10-2014 04:09 AM
How to change superscript footnotes into genuine Word footnotes Corrupted footnotes in Word mythander889 Word 12 09-11-2012 03:58 PM
How to change superscript footnotes into genuine Word footnotes Can Word automatically update footnotes? gib65 Word 2 08-15-2011 01:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft