HighTechTalks DotNet Forums  

inserting a chart

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss inserting a chart in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
smith.mariya@gmail.com
 
Posts: n/a

Default inserting a chart - 04-11-2007 , 03:50 AM






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!!


Reply With Quote
  #2  
Old   
pvdg42
 
Posts: n/a

Default Re: inserting a chart - 04-11-2007 , 07:39 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.


<smith.mariya (AT) gmail (DOT) com> wrote

Quote:
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!!




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.