D
david.f.jenkins
In PowerPoint, I have inserted and selected a text box containing a
blank line followed by two bullets. Here is the code that I am using
to examine that text:
Sub test()
Dim t As TextRange
Dim i As Integer
Dim str As String
Set t = ActiveWindow.Selection.TextRange
For i = 1 To t.Sentences.Count
str = t.Sentences(i).text
Next i
End Sub
When I run the code, t.sentences.count shows as 2. However, the loop
returns the following values:
t.Sentences(1).text = ""
t.Sentences(2).text = "Bullet 1"
if I change the max loop index to t.sentences.count + 1, then
t.Sentences(3).text = "Bullet 2"
It appears to me that the Count method is returning a spurious value,
but there may be some subtleties in its use that I'm missing. Can
someone shed some light on what's going on here? And how I might
program around this? BTW, when the blank line in the text box is
between Bullet 1 and Bullet 2, I don't see this behavior.
Thanks!
blank line followed by two bullets. Here is the code that I am using
to examine that text:
Sub test()
Dim t As TextRange
Dim i As Integer
Dim str As String
Set t = ActiveWindow.Selection.TextRange
For i = 1 To t.Sentences.Count
str = t.Sentences(i).text
Next i
End Sub
When I run the code, t.sentences.count shows as 2. However, the loop
returns the following values:
t.Sentences(1).text = ""
t.Sentences(2).text = "Bullet 1"
if I change the max loop index to t.sentences.count + 1, then
t.Sentences(3).text = "Bullet 2"
It appears to me that the Count method is returning a spurious value,
but there may be some subtleties in its use that I'm missing. Can
someone shed some light on what's going on here? And how I might
program around this? BTW, when the blank line in the text box is
between Bullet 1 and Bullet 2, I don't see this behavior.
Thanks!