Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Selecting a sentence (Word 2000 >)

    Is there a way to select a sentence while recording a macro? I know about CTRL+Mouse Click, but the mouse is disabled during recording!! The help files do not show sentence selection using the keyboard!!!
    Regards,
    Rudi

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Selecting a sentence (Word 2000 >)

    As far as I know, you can't record that. You'll have to use Shift+arrow to select something, then edit the macro after recording. The "current" sentence is Selection.Sentences(1). If selecting is really necessary (just as in Excel, if often isn't), you can use Selection.Sentences(1).Select.

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Selecting a sentence (Word 2000 >)

    OK. Thx Hans. Based on your answer, I think I should have asked this in the next thread I started. As this one could lead into various attempts to modify code to do this!
    See <post#=494453>post 494453</post#> for a possible reference based on selecting text!
    Regards,
    Rudi

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a sentence (Word 2000 >)

    Press subsequently: Escape, F8, F8, F8, Escape
    This cancels extend mode (n case it's on), selects the sentence, and cancel extend mode again.
    The macro lines added during recording are:
    Selection.EscapeKey
    Selection.Extend
    Selection.Extend
    Selection.Extend
    Selection.EscapeKey

  5. #5
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Selecting a sentence (Word 2000 >)

    OK Don. Thats an interesting one.
    Tx a stack!
    Regards,
    Rudi

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a sentence (Word 2000 >)

    This is documented for 2003, but should work for 2000:

    This example collapses the current selection, turns on Extend mode, and selects the current sentence.

    With Selection
    .Collapse
    .ExtendMode = True
    ' Select current word.
    .Extend
    ' Select current sentence.
    .Extend
    End With

    Alan

  7. #7
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Selecting a sentence (Word 2000 >)

    Thx Alan. Hans already set up some code I can use in the thread starting at <post#=494453>post 494453</post#>. I am grateful for your reply though as it further extends (pardon the pun) my options in this regard!
    Cheers
    Regards,
    Rudi

Posting Permissions

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