Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sentence before table not recgonised (2003)

    Hi,

    I've simplified an issue in a macro I'm writing into the following:

    Sub Macro1()
    MsgBox Selection.Sentences(1)
    End Sub

    The problem is that the above works fine for any sentence except the last sentence before a table. In this case it will ignore the sentence the selection is and MsgBox will display the first sentence in the table itself rather than the table where the insertion point was actually located.

    Has anybody found this issue and (hopefully) found a solution?

    Thanks

    Jim B

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

    Re: Sentence before table not recgonised (2003)

    Although that particular problem doesn't occur on my Word 2002 SP-3, it is known that the Sentences acts rather flaky. If you place the insertion point in the last sentence of a cell in the last column of a table, your code will return only the cell marker. And if you select an entire cell in the last column of a table, Selection.Sentences.Count may return one less than the actual number of sentences in the cell.

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Sentence before table not recgonised (2003)

    I have just tried this on Word 2003 (11.8106.8107) SP2 using the attached document, with the cursor placed just before the word quick in the last sentence before the table. Word behaved as I would expect...
    <code>
    ? selection.Sentences(1)
    The quick brown fox jumps over the lazy dog 2.
    </code>
    Attached Files Attached Files
    • File Type: doc x.doc (25.0 KB, 4 views)

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

    Re: Sentence before table not recgonised (2003)

    I've now tested it in Word 2003 SP2 too, and I can't reproduce the error you mention. The last sentence before a table is reported correctly. The problem with the last sentence in the last cell of a column remains.

  5. #5
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sentence before table not recgonised (2003)

    Thanks guys for checking this out so thoroughly.

    I have deleted the test document I was working with last night, and agree that Hans' document doesn't show the bug initially. However, on my computer (fully updated Word 2003) it does show problem if the contents of the first cell in the table are removed. Also I see that it doesn't work correctly for the sentence in the cells in the right column.

    I can live with this personally, but I was trying to develop a macro for distribution which depended on being able to select any sentence anywhere. The selection bug makes the macro do some scary stuff to the user's document and unless I find another way of reliably selecting any sentence I'm really stuck.

    Regards

    Jim B

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Sentence before table not recgonised (2003)

    > However, on my computer (fully updated Word 2003) it does show problem if the contents of the first cell in the table are removed

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> it does the wrong thing for me too, how strange.

    StuartR

  7. #7
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sentence before table not recgonised (2003)

    Stuart, I notice that you are a WMVP. Does this give you the opportunity to suggest that this bug could be fixed? I wonder if it is still in Word 2007. Regards, Jim.

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

    Re: Sentence before table not recgonised (2003)

    A WMVP is a Woody's MVP, not a Microsoft MVP. We have some WMVPs that are also Microsoft MVPs, but in general, WMVPs have no direct line to Microsoft.

  9. #9
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Sentence before table not recgonised (2003)

    But see <post:=605,551>post 605,551</post:> for suggestions on how you can send feedback to Microsoft.

    StuartR

Posting Permissions

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