Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2023, 03:02 AM
Guessed's Avatar
Guessed Guessed is offline VBA Move Footnote References Before Punctuation Windows 10 VBA Move Footnote References Before Punctuation Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

RobiNew
You've piggybacked on someone else's thread and it isn't clear what it is that you are trying to achieve. Maybe explain what the code is supposed to find and what it needs to do when it finds that. And post a sample document that shows the 'before' state that you want the code to work on.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 09-21-2023, 08:13 AM
RobiNew RobiNew is offline VBA Move Footnote References Before Punctuation Windows 10 VBA Move Footnote References Before Punctuation Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 208
RobiNew is on a distinguished road
Default

I apologize! I'm new to these procedures. My aim is to invert reference numbers and punctuation. This I obtained with Macropod's code here below (slightly adapted with regard to some special quotation marks). However, in the text some of the paragraphs involved are left-indented and in these I don't want the inversion to operate. How do I modify (or add to) the code so that the sequence 'punctuation-ref.number' is left untouched in left-indented paragraphs? Thank you for your time!


This is the code I adapted:

Quote:
Application.ScreenUpdating = False
Dim FtNt As Footnote
Dim Rng As Range
With ActiveDocument
For Each FtNt In .Footnotes
Set Rng = FtNt.Reference
With Rng
'Delete spaces etc.
Do While .Characters.First.Previous Like "[ " & Chr(160) & "]"
.Characters.First.Previous.Text = vbNullString
Loop
'Invert ref. number and punctuation
Do While Not .Characters.First.Previous Like "[0-9A-Za-z]" And Not .Characters.First.Previous Like "‹" And Not .Characters.First.Previous Like "«"
.InsertAfter. Characters.First.Previous
.Characters.First.Previous.Delete
Loop
End With
Next
End With
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Move Footnote References Before Punctuation Footnote references in the footnote section losing their style when cut+pasted from same doc emblaw Word 4 12-08-2020 06:23 AM
VBA Move Footnote References Before Punctuation Fix footnote and endnote references to arabic numbers everywhere? KDuncan Word 6 04-28-2020 12:14 AM
VBA Move Footnote References Before Punctuation Word Find won't move out of footnote michaelbriordan Word 3 06-17-2015 10:12 AM
VBA Move Footnote References Before Punctuation How do I keep footnote references and text on the same page bearligirl89 Word 3 11-20-2013 03:33 PM
VBA Move Footnote References Before Punctuation Multiple footnote references jimgard Word 1 07-23-2013 11:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:09 AM.


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