Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2012, 03:30 PM
ACA ACA is offline Inserting key strokes with a macro line Windows 7 Inserting key strokes with a macro line Office 2007
Advanced Beginner
Inserting key strokes with a macro line
 
Join Date: Aug 2010
Posts: 31
ACA is on a distinguished road
Default Inserting key strokes with a macro line

In a WORD macro I need a line to enact the equivalent of the ESC key.
I’m using the “Find and Replace” function in WORD. Sometimes there appears the usual dialogue box asking if I want it to search the rest of the text; I don’t, so I have to click on “NO” in the box or hit the ESC key.
I need a macro line that will do the equivalent to hitting ESC automatically, so that the dialogue box doesn’t appear and halt the search every so often?
Thanks for any help.
ACA
Reply With Quote
  #2  
Old 12-02-2012, 05:26 PM
macropod's Avatar
macropod macropod is offline Inserting key strokes with a macro line Windows 7 64bit Inserting key strokes with a macro line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi ACA,

This sounds more like a need to change '.Wrap = wdFindAsk' to '.Wrap = wdFindStop'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-03-2012, 03:17 AM
ACA ACA is offline Inserting key strokes with a macro line Windows 7 Inserting key strokes with a macro line Office 2007
Advanced Beginner
Inserting key strokes with a macro line
 
Join Date: Aug 2010
Posts: 31
ACA is on a distinguished road
Default

Thanks, Paul. That's the solution, really. Much obliged.

Still, I'd like to know if it's possible in Word VBA, to insert the equivalent to keystrokes. I understand there's such thing as wdKeyEsc (or code 27) for the ESCAPE key, etc. But I d'ont know how to use that.
And in Excel you can write Application.Inkeys {ESC}, I think, to that end. But in Word macros?

But for my current need for Find and Replace, you saved the day. Thanks again.
ACA
Reply With Quote
  #4  
Old 12-03-2012, 03:55 AM
macropod's Avatar
macropod macropod is offline Inserting key strokes with a macro line Windows 7 64bit Inserting key strokes with a macro line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

To insert keystrokes, you can use SendKeys, but you need to be careful how & when you use it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 12-03-2012, 04:40 AM
ACA ACA is offline Inserting key strokes with a macro line Windows 7 Inserting key strokes with a macro line Office 2007
Advanced Beginner
Inserting key strokes with a macro line
 
Join Date: Aug 2010
Posts: 31
ACA is on a distinguished road
Default

Thanks again, Paul.
Yes, I was thinking of SendKeys; and I'll mind your warning
I added to your reputation.
ACA
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you extend line down the trend line to the x axis? madoka Excel 0 11-01-2012 09:18 PM
Inserting key strokes with a macro line Use macro to place line style around graphic AdvanceTheMan Word VBA 1 04-20-2012 08:18 PM
Inserting key strokes with a macro line I indent second line and the first line indents, help. DerekUD Word 1 05-06-2011 11:26 PM
Inserting key strokes with a macro line Need help on Macro 03- Find text - if text is blank then remove line simpleonline1234 Word VBA 1 02-25-2011 02:28 AM
Macro that will go to line # and center text marge Word VBA 0 09-10-2010 12:30 PM

Other Forums: Access Forums

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


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