![]() |
#1
|
|||
|
|||
![]()
Hi,
Please, how to apply a VBA code to the current paragraph without selecting it at all (in general), in my case, I want to apply a find and replace VBA code to the current paragraph without selecting it (just the pointer is in) Code:
Sub TestV2() ' ' Dim Rng As range Set Rng = Selection.range With Rng.Find .Text = "[ñõðóòö~úø]" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Selection.Paragraphs(1).range for Rng but does not work Thanks |
Tags |
find & replace, word 19, word vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Applying a VBA code only on a selected table | RobertDany | Word VBA | 5 | 10-25-2021 09:28 PM |
Applying a VBA code only on a selected text or range | RobertDany | Word VBA | 2 | 10-09-2021 08:31 AM |
![]() |
cheech1981 | Word | 8 | 08-23-2017 03:07 PM |
![]() |
foxtrot | Word | 3 | 07-24-2012 07:30 AM |
Does Word do this when applying Styles to a paragraph a second time? | Bobosmite | Word | 2 | 04-17-2012 02:13 PM |