Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-12-2017, 06:16 PM
thiagoafdoria thiagoafdoria is offline Transfer text to footnotes Windows 8 Transfer text to footnotes Office 2016
Novice
Transfer text to footnotes
 
Join Date: Feb 2017
Posts: 18
thiagoafdoria is on a distinguished road
Default Transfer text to footnotes

Hi!
I'm using a macro to transform every bit of green text in a document into footnotes. A person within the community of a software I use kindly shared the code to this macro. It's the followin one:

Quote:
Sub Makro8()
'
' Makro8 Makro
' Macro for MS Word converting parts of text in a special color (here: green)
' into MS Word footnotes
'
Do While Not ActiveDocument.Range.End - 1 = Selection.Range.End
Selection.Find.ClearFormatting
With Selection.Find
.Font.Color = wdColorGreen
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False


.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection.Font
.Color = wdColorAutomatic
End With
If Selection.Type = wdSelectionIP Then
If ActiveWindow.ActivePane.View.Type = wdPrintView Or ActiveWindow. _
ActivePane.View.Type = wdWebView Or ActiveWindow.ActivePane.View.Type = _
wdPrintPreview Then
ActiveWindow.View.SeekView = wdSeekFootnotes
Else
ActiveWindow.View.SplitSpecial = wdPaneFootnotes
End If
Exit Sub
End If
Selection.Cut
With ActiveDocument.Range(Start:=ActiveDocument.Content .Start, End:= _
ActiveDocument.Content.End)
With .FootnoteOptions
.Location = wdBottomOfPage
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
End With
.Footnotes.Add Range:=Selection.Range, Reference:=""
End With
Selection.PasteAndFormat (wdPasteDefault)
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
ActiveWindow.ActivePane.Close
Loop
End Sub
The problem is, it transforms one part of the green text at a time. If I have 46 pieces of green text, I'd have to execute the macro 46 times. Do you have any idea of what I could modify in order to execute the macro only one time?
I'm running a Microsoft Word 2016 (Office 365) in Windows 8.1. Please note that the macro is working; it just doesn't transform the several pieces into footnotes all at once.
Best regards,
Thiago
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer text to footnotes How to change superscript footnotes into genuine Word footnotes Knounte29 Word VBA 41 01-16-2020 04:48 PM
Transfer text to footnotes Help with Tracking: Bold in body text, but not in Footnotes Bobbety Word 3 05-17-2015 11:17 PM
Transfer text to footnotes word 2007 - footnotes and text box glggluig Word 1 08-10-2014 04:09 AM
All my footnotes turned to blue underlined text. bww Word 0 07-11-2013 08:35 AM
Transfer text to footnotes create footnotes from custom text mosrozen Word VBA 2 06-14-2012 06:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:20 PM.


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