View Single Post
 
Old 04-09-2018, 03:11 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 Kalü View Post
It opens the dialogue which is asking if it should start the serch from the beginning instead of simply replacing all.
That's because you've used:
.Wrap = wdFindAsk
in one place instead of:
.Wrap = wdFindContinue
Quote:
Originally Posted by Kalü View Post
When there are words that are bold, italic AND highlighted it is makking the following paragraph completely bold instead of only making the one word bold, itali and highlighted!
There is nothing about your code that would cause it to do that.

That said, your code's efficiency could be greatly improved. For your first macro, try:
Code:
Sub aabFettKursivQuelldok()
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Format = True
  .Forward = True
  .MatchWildcards = True
  .Wrap = wdFindContinue
  .Font.Underline = True
  .Text = "(?@>)"
  .Replacement.Text = "°°°°^&''''"
  .Execute Replace:=wdReplaceAll
  .ClearFormatting
  .Highlight = True
  .Replacement.Text = "§§§^&%%%%"
  .Execute Replace:=wdReplaceAll
  .ClearFormatting
  .Font.Bold = True
  .Replacement.Text = "####^&&&&&"
  .Execute Replace:=wdReplaceAll
  .ClearFormatting
  .Font.Italic = True
  .Replacement.Text = "~~^&+++"
  .Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote