Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-08-2012, 12:29 PM
Ulodesk Ulodesk is offline Another simple macro problem Windows 7 64bit Another simple macro problem Office 2010 64bit
Word 2013 Expert Cert
Another simple macro problem
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default Another simple macro problem

I have recorded a macro to remove all paragraphs from a document. I would like a macro with which I can remove them from only selected text. This is useful when I receive a document with an included paragraph or more pasted from teh web or a text document, with hard line returns on all lines.

However, even though I select some text before recording the macro, it invariably operates on the entire document. I know that some macros can operate on only a selection -- I have recorded several -- but I can make sense out of the differences. The language in my recording mirrors that in ones that operate globally on the document, starting with

Code:
Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
(although some of my macros start with Selection.WholeStory)



and end with
Code:
 
Selection.Find.Execute Replace:=wdReplaceAll
Every time I try to look up VBA terms, I get completely frustrated by the vast realm thereby encompassed.

I know this is really basic for anyone who has learned programming.

Thanks.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Another simple macro problem Interesting hyperlink macro problem DobberHockey Word VBA 7 03-26-2012 09:26 PM
Word 2000. Problem with Merriam-Webster Macro M.Hat Word 2 12-29-2011 12:00 PM
Simple VBA macro error Formulayeti PowerPoint 1 12-09-2011 10:02 PM
Problem with AutoClose macro and Word 2003 cholo Word VBA 0 07-08-2009 05:48 AM
Simple macro undoable? garon5 Outlook 0 04-20-2007 10:27 AM

Other Forums: Access Forums

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