![]() |
|
#1
|
|||
|
|||
|
I am trying to find a specific word and replace with text copied to my clip board. Currently I am searching the word replacing it with nothing and then pasting it there but it does seem to work correctly any suggestions.
ChangeFileOpenDirectory "X:\sconner\CCD Damage Mechanisms\Mechanisms\" Documents.Open FileName:= _ "X:\sconner\CCD Damage Mechanisms\Mechanisms\Underdeposit Corrosion.docx", _ ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _ PasswordDocument:="", PasswordTemplate:="", Revert:=False, _ WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _ wdOpenFormatAuto, XMLTransform:="" Selection.WholeStory Selection.Copy ActiveWindow.Close Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "(NEXT MECH)" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.PasteAndFormat (wdUseDestinationStylesRecovery) |
| Tags |
| find and replace, userforms, word vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Finding varying text in an MS Word file | sergiodcq | Word | 1 | 07-08-2014 03:12 AM |
| Copied shape/text box pastes as an image in Word | spectator | Word | 0 | 06-04-2014 08:45 AM |
Finding and replacing fonts and styles
|
Adriano | Word VBA | 10 | 03-17-2013 07:08 PM |
| Underlined copied text box | LarryStroup | PowerPoint | 0 | 09-30-2011 11:22 AM |
| PP Slide copied text is underlined | LarryStroup | PowerPoint | 0 | 05-20-2011 11:16 AM |