Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Office 2007, .NET and MSGraph

20 views
Skip to first unread message

MarcG

unread,
Sep 27, 2007, 11:01:01 PM9/27/07
to
I have to build a word 2007 document via external automation (not VSTO). I
have to create charts and graphs in the document.

I started to look up information about MSGraph and saw that it is listed as
a "legacy ActiveX control." Is there a more recent, .NET object that I can
use?

I noticed when I did the Office 2007 install that there was a customization
entry for "MSGRAPH .NET Programability Support" but I haven't been able to
find any information about this and in VS2005, Add Reference doesn't show
anything in the .NET tab for Word, Office, or MSGraph.

If there is a .NET wrapper or better for MSGRAPH (or MSCHART), what is it
and how do I bring it in to my VS2005 project?

If I'm stuck with the ActiveX control, how do I get at it from VS (C#).

A pointer to blogs, articles, books, KB, or library items that deal with
this question would be much appreciated.

Thx

Jialiang Ge [MSFT]

unread,
Sep 28, 2007, 3:19:39 AM9/28/07
to
Hello,

From your post, my understanding on this issue is: you want to know how to
manipulate charts and graphs in Word 2007 via external automation with C#.
If I'm off base, please feel free to let me know.

In order to automate Office solution in .NET, we need to make sure that the
Office Primary Interop Assembly (PIA) has been installed. In other words,
we need to ensure that "Office .NET Programmability Support" is checked
when you install Office. If the PIA is not installed on your computer,
please visit the page: 2007 Microsoft Office System Update: Redistributable
Primary Interop Assemblies
(http://www.microsoft.com/downloads/details.aspx?FamilyID=59DAEBAA-BED4-4282
-A28C-B864D8BFA513&displaylang=en) and install it.

Actually, "Add Reference" in Visual Studio does not show the Office interop
assemblies in the ".NET" tab. It lists them in the "COM" tab after you
install the PIA:
Microsoft Access 12.0 Object Library
Microsoft Excel 12.0 Object Library
Microsoft Graph 12.0 Object Library (used by PowerPoint, Access, and Word
for graphs)
Microsoft InfoPath 2.0 Type Library
Microsoft Outlook 12.0 Object Library
Microsoft PowerPoint 12.0 Object Library
Microsoft Word 12.0 Object Library
Microsoft Office 12.0 Object Library (Office shared functionality)
and so on.

In order to manipulate Graph and Chart in Word, we need to add reference to
Microsoft Word 12.0 Object Library and Microsoft Graph 12.0 Object Library
in your application. The MSDN article
http://msdn2.microsoft.com/en-us/library/aa198537(office.10).aspx
introduces the Microsoft Graph Object Model in detail. And here are a few
more articles talking about how to automate Microsoft Word, how to edit MS
graph programmatically, etc:

How to automate Microsoft Word to create a new document by using Visual C#
http://support.microsoft.com/kb/316384
It has samples about how to use MSGraph.

How To Automate An Embedded MSGraph Object with Visual Basic
http://support.microsoft.com/kb/244589#appliesto

How to Edit an MS Graph Object Programmatically
http://support.microsoft.com/kb/190239

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge (jia...@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

MarcG

unread,
Sep 28, 2007, 5:13:00 PM9/28/07
to
Jialiang ,

That was very helpful - thx. I gather I'm stuck with activeX for a while,
but at least now I know how to use it.

Marc

engrforever

unread,
Jun 25, 2008, 2:35:07 PM6/25/08
to

"Jialiang Ge [MSFT]" wrote:

I have interest in using the MSGRAPH/MSCHART to develop line graphs in a
VB>NET (2005) application. Can the same set of instructions be used for my
needs?

Dennis

unread,
Jun 26, 2008, 2:44:50 AM6/26/08
to
Yes,

Please have a look at
http://www.vb123.com/Toolshed/99_graphs/msolechart.htm

"engrforever" <engrf...@discussions.microsoft.com> wrote in message
news:7CF93A1E-0F38-4554...@microsoft.com...

DanH

unread,
Aug 5, 2008, 1:42:12 PM8/5/08
to
Just so I am clear are there no differences between MS Graph Object library
8.0 and MS Graph Object Library 12.0?
0 new messages