Modify a text box into a chart

A

Alex St-Pierre

Hi !
I'm wondering if there a way to modify a text box inside a chart ?
1)When I loop on the text box of the ActiveDocument (Dim sh As Word.Shape,
For Each sh In ThisDocument.Shapes, Debug.Print sh.Name), the text box inside
the word chart is not include.
2) I tried the following to edit the graph but I don't know how to reach the
text box range include in the chart. Any idea?
Dim rng As Word.Range
Dim of As Word.OLEFormat
Dim oChart As Graph.Chart
Set rng = ThisDocument.Bookmarks("BarChart").Range
Set of = rng.InlineShapes(1).OLEFormat
On Error Resume Next
of.DoVerb wdOLEVerbInPlaceActivate
On Error GoTo 0
Set oChart = of.Object

Thank you!
Alex
 
C

Cindy M.

Hi Alex,
I'm wondering if there a way to modify a text box inside a chart ?
No, not when using MS Graph. If you were using the Excel charting engine, then
it would be possible. But the MS Graph object model does not support modifying
any Shapes (textboxes) after they've been inserted. Unfortunately.
1)When I loop on the text box of the ActiveDocument (Dim sh As Word.Shape,
For Each sh In ThisDocument.Shapes, Debug.Print sh.Name), the text box inside
the word chart is not include.
2) I tried the following to edit the graph but I don't know how to reach the
text box range include in the chart. Any idea?
Dim rng As Word.Range
Dim of As Word.OLEFormat
Dim oChart As Graph.Chart
Set rng = ThisDocument.Bookmarks("BarChart").Range
Set of = rng.InlineShapes(1).OLEFormat
On Error Resume Next
of.DoVerb wdOLEVerbInPlaceActivate
On Error GoTo 0
Set oChart = of.Object

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

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