Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-27-2012, 11:05 AM
Ulodesk Ulodesk is offline Stumped by the recorder again Windows 7 64bit Stumped by the recorder again Office 2010 64bit
Word 2013 Expert Cert
Stumped by the recorder again
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default Stumped by the recorder again


I am trying to create a macro using Word's "Find and select all the highlighted words" ("the" in this trial run) to then copy them and paste into a new document. The macro, which I have tried recording various ways (i.e., from the beginning of the porcess, from having allteh words already highlighted, etc.) fails each time, indicating as the culprit the last line that I have included here, Selection.Copy, wiht a note that nothing is selected. I have had no luck searching or trying to otherwise create a "save selection" command in simpler recorded macros. Can you tell me the trick to this? Thanks in advance.

Code:

Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = "the"
.Replacement.Text = "the"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Copy
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stumped on Grouping with Custom Fields... ViperMan Project 1 06-22-2011 01:31 AM
Stumped by the recorder again Track chages combine: Stumped! Ulodesk Word 2 01-03-2011 11:43 AM
Stumped- MS Office OLE Links are "Validating". Takes Forever mrbill Office 0 11-09-2010 11:49 AM
Stumped With Mail Merge Formula JennEx Mail Merge 0 05-28-2010 07:44 AM
Help needed using the serial number date with sumifs - whole office is stumped FraserKitchell Excel 3 01-06-2010 12:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:24 PM.


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