Hmmm -- getting an error at the last stage sorry..... This is what the
entire piece of code looks liek -- can you teel me which piece is the culprit
and how it should appear? I am getting message that 'compile error expecyed
End With'
(Once the downloaded document is in Word, I run the macro and it shuffles
everything around into the rquired format, searching, replacing etc. Have I
added the replace font piece in at the wrong point perhaps and that's why
incorrect?)
Grateful for any assistance again.
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:="l"
Selection.Range.InsertAutoText
Selection.TypeBackspace
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " Services"
.Replacement.Text = " Days ** Refer above **"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "per Service for "
.Replacement.Text = "per Day for "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "OTHER INCLUSIONS^p^p"
.Replacement.Text = "OTHER INCLUSIONS^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "INSURANCE DETAILS^p^p"
.Replacement.Text = "INSURANCE DETAILS^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "ACCOMMODATION DETAILS^p^p"
.Replacement.Text = "ACCOMMODATION DETAILS^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "FLIGHT DETAILS^p^p"
.Replacement.Text = "FLIGHT DETAILS^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "OTHER DETAILS^p^p"
.Replacement.Text = "OTHER DETAILS^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.SmallScroll Down:=56
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "OTHER DETAILS^p^p"
.Replacement.Text = "OTHER DETAILS^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Date of Departure"
.Replacement.Text = "OTHER DETAILS^p"
.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.MoveDown Unit:=wdLine, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend
Selection.Copy
Selection.Cut
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:="m"
Selection.Range.InsertAutoText
Selection.TypeBackspace
Selection.Find.ClearFormatting
With Selection.Find
.Text = "We are pleased to confirm"
.Replacement.Text = "OTHER DETAILS^p"
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="i"
Selection.Range.InsertAutoText
Selection.TypeParagraph
Selection.Find.ClearFormatting
With Selection.Find
.Text = "CONFIRMATION"
.Replacement.Text = "OTHER DETAILS^p"
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Font.Size = 12
Selection.Font.Bold = wdToggle
Selection.Font.Name = "Arial"
Selection.TypeText Text:="TRAVEL "
Selection.MoveUp Unit:=wdLine, Count:=2
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.Paste
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.MoveRight Unit:=wdWord, Count:=3
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.ColorIndex = wdRed
With Selection.Find
.Text = "** Refer above **"
.Replacement.Text = "** Refer above **"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.ClearFormatting
.Font.Name = "Times New Roman"
.Replacement.ClearFormatting
.Replacement.Font.Name = "Arial"
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub