Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-01-2015, 01:20 AM
srinidhi.mv88 srinidhi.mv88 is offline Replace a "==>" with symbol Windows 7 64bit Replace a "==>" with symbol Office 2010 64bit
Novice
Replace a "==>" with symbol
 
Join Date: Apr 2015
Posts: 11
srinidhi.mv88 is on a distinguished road
Lightbulb Replace a "==>" with symbol

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
Reply With Quote
  #2  
Old 07-01-2015, 01:47 AM
gmayor's Avatar
gmayor gmayor is offline Replace a "==>" with symbol Windows 7 64bit Replace a "==>" with symbol Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 07-01-2015, 01:54 AM
srinidhi.mv88 srinidhi.mv88 is offline Replace a "==>" with symbol Windows 7 64bit Replace a "==>" with symbol Office 2010 64bit
Novice
Replace a "==>" with symbol
 
Join Date: Apr 2015
Posts: 11
srinidhi.mv88 is on a distinguished road
Default

This worked. You are genious. Thanks a lot
Reply With Quote
Reply



Similar Threads
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
Replace a "==>" with symbol I'm typing an "a" but getting the alpha symbol nperry Word 2 08-09-2012 05:53 PM
Replace a "==>" with symbol replace data from variable with "sub and super script" from excel to word by vba krishnaoptif Word VBA 9 06-22-2012 05:08 AM
Replace a "==>" with symbol How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft