adding data to an embedded chart dynamically

M

mstuehler

All,

I've created a word document that contains an embedded chart (using Insert >
Picture > Chart) The chart's layout optin is "In front of text".

What I'd like to do change/modify the data in the datasheet of this chart
using vba or vbscript, but I don't know how to reference it.

I've done the same thing in PowerPoint with this:

Set oApp = CreateObject("Powerpoint.Application")
Set oPres = oApp.Presentations.Open("C:\Presentation.ppt")
Set oSlide = oPres.Slides("slide1")
Set oChart = oSlide.Shapes("chart")
with (oChart..OLEFormat.Object.Application.DataSheet)
.Range("A1").Value = 100
End With

But I don't understand the object model of word well enough to do this in
Word. I also don't know how to name objects in Word so that I can reference
them.

Many thanks in advance for any insight or advice!

Cheers,
Matt Stuehler
 

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