Solved

How do I determine selected text in the title of a PowerPoint chart using VBA 2010?

Posted on 2013-12-13
4
433 Views
Last Modified: 2014-01-02
Hello all.

Does anyone know how to extract the selected text (if any) in the title of a chart in PowerPoint 2010 using VBA?

"...Selection.TextRange" and "...Selection.TextRange2" don't work (I get a "... value out of range" error). Also, "...Selection.HasChildShapeRange" returns false.

I know about "...Selection.ShapeRange(1).Chart.ChartTitle.Caption", but that returns the whole title, not the text selected within it...

I'm stumped!

Thanks in advance for any help...
0
Comment
Question by:RIBBIT_Productions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:JSRWilson
ID: 39718627
There's no way to do this (and it's a major oversight in my view). As you suggest you can get the whole title but not the selection.  You can get it in Excel but not in Powerpoint.

Any reference to Selection will return the chart. The only way I can think of is to call copy using CommandBars.ExecuteMso("Copy") and then paste the text somewhere to read it. My experience is this is unreliable but might be worth playing.
0
 

Author Comment

by:RIBBIT_Productions
ID: 39746618
Thanks, JSRWilson. I ended up using "...selection.copy" which I think is more reliable than the ExecuteMso command - correct me if I'm wrong...

Whatever the method though, copying the selection changes the content of the clipboard, which I don't like, but after researching some more I can't find a better solution so it will have to be it.

Happy new year everyone!
0
 

Author Comment

by:RIBBIT_Productions
ID: 39752895
I've requested that this question be closed as follows:

Accepted answer: 0 points for RIBBIT_Productions's comment #a39746618

for the following reason:

Found better solution.
0
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
ID: 39752425
Actually it is exactly the same!
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outline From PowerPoint 2010 it is possible to have shapes appear in front of video, in earlier versions video always played in front of other shapes. This means it is possible to have captions animated to appear in front of video. Users who h…
Setting the Scene Animations in PowerPoint are a great tool to convey messages when used carefuly with the content of your slides. There are plenty of animation effects and options, including a Repeat feature for individual animation effects. …
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question