MarcusStringer
IS-IT--Management
I've neally got it...but
this is what I'm trying to do
I have a word file which has 200 odd footnotes.
I have to change the footnote numbers to<FootnoteNumber>
[[FR <FootnoteNumber>]]
So it reads 1 [[FR 1]], 2 [[FR 2]] etc all the way to 200.
I can get most of it through doing a find for ^f and replacing with ^&[[FR ^&]],
but the second ^& becomes footnote 2 instead of one.
So I was thinking about just doing a find for ^f and replacing it with ^& [[FR 1]], and somehow have that 1 count on so when it hits the next footnote it will be 2, and so on (like an autonumber).
What I can't do is stop the loop when it gets to the end.
Please help..
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 21/10/04 by Marcus Stringer
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = "[[E ]]^p "
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^f"
.Replacement.Text = "^&[[FR ]]"
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
With Selection.Find
.Text = "^f"
.Replacement.Text = "^& [[FR ]]"
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
With Selection.Find
.Text = "FR"
.Replacement.Text = "F"
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "]]"
.Replacement.Text = "^&[[FR ]]"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do
With Selection.Find
.Text = "]]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=""
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"SEQ OLE_LINK1 \n ", PreserveFormatting:=True
Selection.MoveRight Unit:=wdCharacter, Count:=2
Loop
this is what I'm trying to do
I have a word file which has 200 odd footnotes.
I have to change the footnote numbers to<FootnoteNumber>
[[FR <FootnoteNumber>]]
So it reads 1 [[FR 1]], 2 [[FR 2]] etc all the way to 200.
I can get most of it through doing a find for ^f and replacing with ^&[[FR ^&]],
but the second ^& becomes footnote 2 instead of one.
So I was thinking about just doing a find for ^f and replacing it with ^& [[FR 1]], and somehow have that 1 count on so when it hits the next footnote it will be 2, and so on (like an autonumber).
What I can't do is stop the loop when it gets to the end.
Please help..
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 21/10/04 by Marcus Stringer
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = "[[E ]]^p "
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^f"
.Replacement.Text = "^&[[FR ]]"
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
With Selection.Find
.Text = "^f"
.Replacement.Text = "^& [[FR ]]"
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Size = 10
.Superscript = True
.Subscript = False
End With
With Selection.Find
.Text = "FR"
.Replacement.Text = "F"
.Forward = True
.Wrap = wdFindContinue
.AllDocuments = True
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "]]"
.Replacement.Text = "^&[[FR ]]"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do
With Selection.Find
.Text = "]]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=""
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"SEQ OLE_LINK1 \n ", PreserveFormatting:=True
Selection.MoveRight Unit:=wdCharacter, Count:=2
Loop