VBA select paragraph by insertion point

  • Thread starter Thread starter caten
  • Start date Start date
C

caten

Is there a way in VBA to select the paragraph that the insertion point is
currently in?

I want to be able to click in a bullet item and set the text formatting for
that bullet item (without having to manually select all of the text in the
bullet item).

I see that I can modify paragraph formatting using
ActiveWindow.Selection.TextRange.ParagraphFormat, but when I try to format
the text using ActiveWindow.Selection.TextRange.Font, nothing happens
(because there is no text actually selected).

I was hoping I could use the empty selection to define the position from
which to select the parent object, which would be the paragraph that the
insertion point is currently in, but there doesn't seem to be a way to do
that.

Any other ideas?
 
Is there a way in VBA to select the paragraph that the insertion point is
currently in?

I want to be able to click in a bullet item and set the text formatting for
that bullet item (without having to manually select all of the text in the
bullet item).

I see that I can modify paragraph formatting using
ActiveWindow.Selection.TextRange.ParagraphFormat, but when I try to format
the text using ActiveWindow.Selection.TextRange.Font, nothing happens
(because there is no text actually selected).

I was hoping I could use the empty selection to define the position from
which to select the parent object, which would be the paragraph that the
insertion point is currently in, but there doesn't seem to be a way to do
that.

Any other ideas?

Off the top of my head did you try something like
ActiveWindow.Selection.Paragraph.TextRange

Or ActiveWindow.Selection.Paragraph.Select

I haven't tried either so I don't know if they will work.

--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Nope, "Method or data member not found" for both suggestions.

I suspect this is because the Selection object is empty, so it doesn't have
a paragraph to be accessed or selected.
 
Back
Top