Automating powerpoint creation using VB

  • Thread starter Thread starter Edward
  • Start date Start date
E

Edward

Hello,

I'm working on creating some VB code to take excel information and generate
a powerpoint document based on it. Right now I'm having a very difficult time
finding ways to create a shape in a given location. For instance, say I want
to create a box of a given size at a given location in the new powerpoint
document... I haven't been able to find any commands that allow that. The
closest I've found is this: ppSlide2.Shapes.AddOLEObject cLeft, cTop, cWidth,
cHeight, "MSGraph.Chart"

However this creates a chart, not a simple shape, which is what I want.

I also want to be able to create lines to connect objects together, and so
far I haven't found any references to functions that can do this.

Can anyone help?

Thanks,
Edward
 
Hello,

I'm working on creating some VB code to take excel information and generate
a powerpoint document based on it. Right now I'm having a very difficult time
finding ways to create a shape in a given location. For instance, say I want
to create a box of a given size at a given location in the new powerpoint
document... I haven't been able to find any commands that allow that. The
closest I've found is this: ppSlide2.Shapes.AddOLEObject cLeft, cTop, cWidth,
cHeight, "MSGraph.Chart"

However this creates a chart, not a simple shape, which is what I want.

I also want to be able to create lines to connect objects together, and so
far I haven't found any references to functions that can do this.

Can anyone help?

Thanks,
Edward

ppSlide2.Shapes.AddShape msoShapeRectangle, cLeft, cTop, cWidth, cHeight

should add a rectangle for you. If you want a different shape, there are
bunches of them.

--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Back
Top