Re: Modify a text box into a chart



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 :-)

.



Relevant Pages

  • RE: Insert graph with macro
    ... I just want the graph in the document that I’m ... that could be used to create the chart from. ... manipulated after inserting the chart. ... Dim o_OLE As Word.OLEFormat ...
    (microsoft.public.word.vba.general)
  • RE: Insert graph with macro
    ... I can insert the graph. ... Dim grphDatenblatt As Graph.DataSheet ... 'Das Diagramm im Dokument erstellen... ...
    (microsoft.public.word.vba.general)
  • RE: Insert graph with macro
    ... Where does "Option Explicit" go? ... would be if it were the direct source for the graph chart. ... Sub Test() ... Dim o_OLE As Word.OLEFormat ...
    (microsoft.public.word.vba.general)
  • Problem Inserting graph
    ... But shows a bar chart before changing to a line graph which can take ... Dim o_OLE As Word.OLEFormat ... a newly inserted chart is 4x4. ... Set diag = Nothing ...
    (microsoft.public.word.vba.general)
  • Re: Print Charts
    ... I presume your files are in a same folder. ... this would try to print every graph in workbooks in the folder, as i'm not sure your graphs are in worksheets or in graph sheet. ... Dim sh As Worksheet ... Set chobj = Nothing ...
    (microsoft.public.excel.programming)

Loading