all groups > dotnet academic > april 2007 >
You're in the

dotnet academic

group:

inserting a chart


inserting a chart smith.mariya NO[at]SPAM gmail.com
4/11/2007 12:50:49 AM
dotnet academic:
hi,
my name is Mariya. Now i am working on vb.net. i have some problems
with inserting a chart on the slide. i have insert a slide having
'PptlayoutText' layout. i went through the each shape. now i want to
insert a chart of any desired type on this slide. but i cant. i have
added the reference of Microsoft graph. where should i write the code
for it? and which method i have to use?
following is my code,

pptApplication = CType(applicationObject, PowerPoint.Application)
Dim slideCount As Integer

slideCount = pptApplication.ActivePresentation.Slides.Count

slideCount = slideCount + 1

' inserting a slide

currentslide =
pptApplication.ActivePresentation.Slides.Add(index:=slideCount,
Layout:=PpSlideLayout.ppLayoutText)

Dim shapeNumber As Integer = 0
With currentslide
For Each oShape In currentslide.Shapes 'going through
each shape
If shapeNumber = 0 Then
oShape.Name = "myText1"
oShape.TextFrame.TextRange.Text = "Enter your h
question....."
ElseIf shapeNumber = 1 Then
oShape.Name = "myText2"
oShape.TextFrame.TextRange.Text = "Enter your
answer options....."

oShape.TextFrame.TextRange.ParagraphFormat.Bullet.Style =
PpNumberedBulletStyle.ppBulletAlphaLCPeriod

oShape = currentslide.Shapes.AddOLEObject(Left:=100, Top:=100,
Width:=350, Height:=200, ClassName:="MsGraph.Chart")
obj = oShape.OLEFormat.Object
obj.ChartType = XlChartType.xl3DPie

End If
shapeNumber += 1
Next


End With

Waiting for ur reply. can you plz send the reply as soon as possible.
its urgent! thanks!!
Re: inserting a chart pvdg42
4/11/2007 6:39:02 AM
I'm crossposting your question to the Visual Basic.NET group, Mariya, to try
to get you a good answer from the people who know VB best.


[quoted text, click to view]

AddThis Social Bookmark Button