View Single Post
 
Old 04-10-2018, 09:46 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
The second macro cannot be done in your style because the find what text differs for bold, italic, underlined and highlighted - right?
Not at all. Exactly the same approach can be taken.
Code:
Sub aabFettKursivZieldok()
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Format = True
  .Forward = True
  .MatchWildcards = True
  .Wrap = wdFindContinue
  .Replacement.Text = "\1"
  .Text = "°°°°(?@>)''''"
  .Replacement.Font.Underline = True
  .Execute Replace:=wdReplaceAll
  .Replacement.ClearFormatting
  .Text = "§§§(?@>)%%%%"
  .Replacement.Highlight = True
  .Execute Replace:=wdReplaceAll
  .Replacement.ClearFormatting
  .Text = "####(?@>)&&&&"
  .Replacement.Font.Bold = True
  .Execute Replace:=wdReplaceAll
  .Replacement.ClearFormatting
  .Text = "~~(?@>)+++"
  .Replacement.Font.Italic = True
  .Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub
Quote:
Originally Posted by Kalü View Post
I thought so too, but please hava alook at the following picture
...
I have no idea why it is doing this
I don't see anything in your post that evidences either your first macro or mine has been run in it (there's none of your prefix/suffix strings, for example).
Quote:
Originally Posted by Kalü View Post
And I have an additional question: Is it possible to turn off hyphenation in the document by using a vba-command and integrate this command in the first macro?
All you need for that is:
ActiveDocument.AutoHyphenation = False
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote