![]() |
#1
|
|||
|
|||
![]()
Hello all,
I had written a macro to find and replace "==>" to Unbenannt.JPG automatically. But its not changing this to symbol what i required. Here is the code Sub Replace_Symbol() Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "==>" .Replacement.Text = "==>" .Replacement.Style = ActiveDocument.Styles("Emphasis") .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Please help me to achieve it. Thanks a lot. Regards, Srinidhi |
#2
|
||||
|
||||
![]()
Use the following instead
Code:
Sub Replace_Symbol() Dim orng As Range Set orng = ActiveDocument.Range With orng.Find Do While .Execute("==>") orng.Font.name = "Wingdings" orng.Text = Chr(232) orng.Collapse 0 Loop End With lbl_Exit: Set orng = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
![]()
This worked. You are genious. Thanks a lot
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to hide text in the plus symbol "+", like in *.chm files | Alexis | Word | 4 | 06-02-2013 12:04 PM |
Shortcut for currency symbol "฿" | jdavid10 | Word | 3 | 09-21-2012 03:56 PM |
![]() |
nperry | Word | 2 | 08-09-2012 05:53 PM |
![]() |
krishnaoptif | Word VBA | 9 | 06-22-2012 05:08 AM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |