Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-04-2014, 12:33 AM
mkhuebner mkhuebner is offline How to find and select text in a document? Windows 7 64bit How to find and select text in a document? Office 2010 64bit
Novice
How to find and select text in a document?
 
Join Date: Feb 2014
Posts: 7
mkhuebner is on a distinguished road
Default How to find and select text in a document?

I'm trying to create a Word 2010 macro that finds, selects, and reformats a single word in my document starting from the current cursor position. During recording of the macro, I've tried to use Find in the menu (Ctrl-F) but nothing is recorded in my macro for the find operation even though the cursor moves and highlights the found word. I've tried using the code below but that is also not moving the current cursor position to this word. Can somebody tell me how to record a Find text operation in a Word macro or else tell me what the correct VBA code is to do this? Thanks in advance!

Selection.Find.Text = "Synposis"
Selection.Find.Execute
Selection.Style = ActiveDocument.Styles("Body Text")
Selection.Font.Bold = wdToggle
Reply With Quote
 

Tags
macro find text



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find and select text in a document? Select a area in a Word Document Peter Stahl Word VBA 2 08-09-2013 03:18 AM
How to find and select text in a document? Unable to Select Multiple folders in Outlook 2007 Advance Find gregory Outlook 2 04-28-2012 10:53 PM
How to find and select text in a document? Select statement to a new document ishaw Word 1 10-17-2011 02:23 AM
Unable to select anything in an MS Word Document PaulT Word 0 08-08-2011 07:45 PM
How to find and select text in a document? Select printer to document JosL Office 3 03-07-2009 12:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:58 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