Automating powerpoint creation using VB

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
 
D

David Marcovitz

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
 
S

Shyam Pillai

Use AddShape, AddTextBox, AddLine methods for a Slide object to begin with.
 

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