Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brooklyn, New York, USA
    Posts
    200
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Selecting text from within a macro record (xp)

    I'm trying to record a macro that deletes a chunk of text that is repeated and regularly placed, so that if I could select that paragraph that part of the macro would work. The only problem is that the only way I can see to select a paragraph is to double click on it, and a recording macro doesn't allow clicks, only keyboard strokes. Is there a way to keyboard select a paragraph? I seem to recall in older programs you could do this. And please, no advice to write the macro - I don't know how to do that. Thanks!

  2. #2
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Putnam Valley, New York, USA
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting text from within a macro record (xp)

    Hitting the F8 key four times usually selects the paragraph, if your cursor is already somewhere in the correct paragraph but I'm not sure that the macro recording is smart enough to allow you to do what you are hoping for.

    I'm not a great macro writer, either, but it is helpful to record the macro, and then go in to edit the macro just to see what the recorder has written. In many cases, an experienced Word user will recognize portions of the code. Copying the written code in a message here gives other Loungers a better idea of what you are trying to accomplish, and sometimes they will give you suggestions of what to write.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Selecting text from within a macro record (xp)

    <P ID="edit" class=small>(Edited by jscher2000 on 03-Jan-06 13:56. )</P>Are you selecting paragraphs in a particular sequence, or do you want to select the "current" paragraph where the insertion point is located? In the latter case, use Ctrl+UpArrow, then Ctrl+Shift+DownArrow. This will include the final paragraph marker. If you don't want to include it, use Shift+LeftArrow to shrink the selection as your third step.

    There are lots of other useful shortcut keys somewhere in the help file, most of which are able to be recorded, unlike those mouse moves. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Added: Unfortunately, if your insertion point already is at the start of the paragraph, what I've described will select the previous paragraph. The safest approach to selecting the "current" paragraph is this, which you can type into the macro editor after recording all the other steps: Selection.Paragraphs(1).Range.Select (that means, select the entire first paragraph "in" the current selection).

  4. #4
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brooklyn, New York, USA
    Posts
    200
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Selecting text from within a macro record (xp)

    thanks! This worked beautifully!

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brooklyn, New York, USA
    Posts
    200
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Selecting text from within a macro record (xp)

    Good suggestion. I'll remember it for the next problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •