Word 2002 Range Problem

C

Cutty

I can used wdoc1.paragraphs.item(i).range.text to get the text of that
range, but sometimes, when I use
wdoc1.paragraphs.item(i).range.Sentences.item(1).text to get the first
sentence of that range, it gives me some text that is not the first
sentence, for example this paragraph:

Holland College (Charlottetown, à l'Î.-P.-É.) : durée de deux ans,
techniques automobiles;

when I used wdoc1.paragraphs.item(1).range.Sentences.item(1).text, it
gave me
'-'

anybody knows what is going on?

It works fine with Word2000

by the way, I used Delphi 7.0 and WordXp

Thanks!

Cutty
 
C

Cindy Meister -WordMVP-

Hi Cutty,

I concur. I'd say a bug has slipped into what VBA uses to pick up a
sentence. What did you used to get?

Best I can tell, it's a problem with the parentheses + a period within
parentheses that's causing the behavior.
I can used wdoc1.paragraphs.item(i).range.text to get the text of that
range, but sometimes, when I use
wdoc1.paragraphs.item(i).range.Sentences.item(1).text to get the first
sentence of that range, it gives me some text that is not the first
sentence, for example this paragraph:

Holland College (Charlottetown, à l'Î.-P.-É.) : durée de deux ans,
techniques automobiles;

when I used wdoc1.paragraphs.item(1).range.Sentences.item(1).text, it
gave me
'-'

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top