Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-15-2012, 02:56 PM
macropod's Avatar
macropod macropod is offline Limiting a macro to a selection Windows 7 64bit Limiting a macro to a selection Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

It's all to do with the '.Wrap' property, which can Ask, Stop, or Continue.

As for the 'extra' lines, the macro recorder does generate quite verbose code. Your macro could at least be reduced to:
Code:
Sub ParasStripSelected()
With Selection.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = "^p"
  .Replacement.Text = " "
  .Forward = True
  .Wrap = wdFindAsk
  .Format = False
  .MatchWildcards = False
  .Execute Replace:=wdReplaceAll
End With
End Sub
Further reductions are also possible, but you're not going to gain anything in processing speed and, depending on what the previous Find/Replace used as its parameters, you might need to clear/reset them anyway.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
limit macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Limiting a macro to a selection Selection is locked Thokkle Word 1 04-01-2012 06:46 PM
How do you add to a selection list? bryanarn Excel 2 03-05-2012 05:04 PM
Macro to populate a text form field based on dropdown selection koloa Word 0 10-20-2011 11:52 AM
Limiting the times that it runs hchbiker PowerPoint 0 02-09-2011 08:36 AM
Limiting a macro to a selection Save Selection cksm4 Word VBA 25 01-30-2011 11:44 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:08 AM.


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