Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Moving around in my Document

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> All

    The phrase, or sentence <font color=blue>"The lazy quick brown fox jumped over the fences"</font color=blue> is some times used to test how fonts look, because it has all the letters. I don't see a <font color=red>"G"</font color=red>, so do I have the phrase right?

    But I am using this, to test my code. I am writing some code that navigates, so I did this:

    '/Select Current Line.
    With Selection
    .HomeKey Unit:=wdLine
    .MoveRight unit:=wdLine, Extend:=wdExtend
    End With

    But I get an Run-Time Error?! 4120 Bad Parameter, but MS-Word accepts all of the parameters OK? Can I not advance by one line <img src=/S/confused.gif border=0 alt=confused width=15 height=20>? Must I use the End Key <img src=/S/rtfm.gif border=0 alt=rtfm width=24 height=23>?

    Thanks for any clarification...

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    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: Moving around in my Document

    <P ID="edit" class=small>(Edited by jscher2000 on 09-Aug-03 22:11. Whoops)</P>The quick brown fox jumped over the lazy dog.

    Try wdParagraph as the unit.

    Correction: Sorry, wdParagraph is used with MoveDown, not MoveRight (duh!). The units that are valid with MoveRight are wdCell, wdCharacter, wdWord and wdSentence. To go to the end of the line (regardless of whether it ends a paragraph), yes, you should use the EndKey method.

  3. #3
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Moving around in my Document

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> and Good Morning, Good Night to you where ever time zone you are in.

    OK so its the dog, and not the fence...

    And I got the units from the OLH, and that is what told me to use a wdLine. But, I guess I need to use the EndKey.

    Here its night, and I need to go <img src=/S/snore.gif border=0 alt=snore width=32 height=15>

    See Ya later

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

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

    Re: Moving around in my Document

    I think the correct expression uses the word "jumps" rather than "jumped", so as to include an S in the output. It should therefore read something like:
    "The fox brown over quick jumps dog lazy the."

    I'm really good at finding the correct words. Soon I'll be working on getting them in the right order. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Alan

  5. #5
    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: Moving around in my Document

    Good point! If only I could ever remember that random text trick, I could have pasted it in and avoided confusing up my verb.

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

    Re: Moving around in my Document

    You mean =Rand() or =Rand(m,n) where m and n are the number of paragraphs and of sentences per paragraph, respectively?

Posting Permissions

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