Microsoft.Office.Interop.Graph from C#

K

kc22033

Is there documentation available for the Interop.Graph PIA? I've done lots of
searching and not much finding! I'm trying to automate the
creation/manipulation of graph/chart objects in an MSWord document and have
managed to get through some of the bare-bones basics, but I'm struggling to
get any further without adequate documentation.

Many thanks!
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?a2MyMjAzMw==?=,
Is there documentation available for the Interop.Graph PIA? I've done lots of
searching and not much finding! I'm trying to automate the
creation/manipulation of graph/chart objects in an MSWord document and have
managed to get through some of the bare-bones basics, but I'm struggling to
get any further without adequate documentation.
There is a Help file (VBAGR10.chm) for the object model, but for the most part,
as long as you're manipulating the actual chart, it's the same as Excel's
charting OM. Both actually use the same charting engine, but have a different
"data store" (Excel a worksheet in a workbook, Graph a Datasheet).

Note that you can't do much with any textboxes in Graph; there is no interface
for that.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :)
 
K

kc22033

Cindy,

Thanks for the pointer - I found the .chm file; however, the datamodel
described therein does not match the datamodel for
Microsoft.Office.Interop.Graph.

As an example, the help file points to a "Application.Datasheet.Range"
property:

With myChart.Application
.DataSheet.Range("A1").Value = 3.14159
End With

However, the Interop.Graph Chart object doesn't have a Range attribute there
(there's "Cells", "Columns", and "Rows" - but no "Range"). I'm sure that I
can muddle around and figure this out, but it would be really nice to have
some documentation to match the interface I'm trying to use!

Thanks again!
KLC
 
C

Cindy M -WordMVP-

Hi kc,

I understand your frustration, but as far as I know, that's the extent of the
documentation available. MS Graph in its current incarnation is on its way out,
so there isn't a lot of "incentive" for any new documentation.

I've done some "fiddling" with the object model in C# and I managed to get
things to work. Setting colors was rather hit-and-miss and gave me the most
problems because the .NET System.Drawing.Color values don't correspond to the
RGB MS Graph uses. I had to use .MediumPurple, for example, to get orange
(instead of RGB(255, 153, 0) then assign it like this:

dataSeries.Bordercolor = (int) color.ToArgb

You can define a "Range" on the datasheet like this:

graph.Range dataRange = (graph.Range) grphDatasheet.Cells[rowCounter,
colCounter];
dataRange.set_Value(objMissing, value);

Thanks for the pointer - I found the .chm file; however, the datamodel
described therein does not match the datamodel for
Microsoft.Office.Interop.Graph.

As an example, the help file points to a "Application.Datasheet.Range"
property:

With myChart.Application
.DataSheet.Range("A1").Value = 3.14159
End With

However, the Interop.Graph Chart object doesn't have a Range attribute there
(there's "Cells", "Columns", and "Rows" - but no "Range"). I'm sure that I
can muddle around and figure this out, but it would be really nice to have
some documentation to match the interface I'm trying to use!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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