From: Edward on
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
From: David Marcovitz on
On 5/4/10 4:30 PM, Edward wrote:
> 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
From: Shyam Pillai on
Use AddShape, AddTextBox, AddLine methods for a Slide object to begin with.


--
Regards,
Shyam Pillai
Handout Wizard: http://skp.mvps.org/how. PowerPoint 2010 (32-bit/64-bit)
versions supported.


"Edward" <Edward(a)discussions.microsoft.com> wrote in message
news:24DDABEC-8617-408C-B27E-60BB086848E9(a)microsoft.com...
> 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