Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 06-08-2012, 06:24 PM
Charles Kenyon Charles Kenyon is offline Another simple macro problem Windows Vista Another simple macro problem Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,470
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

It isn't basic to me, but have you tried AutoFormat?

See Cleaning up text pasted from the Web
Reply With Quote
Reply



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 09:39 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