VBA & MS Graph

M

mcalex

I'm trying to move a chart created by Graph in Powerpoint One from the
top left corner of the slide (where it gets put by default) to the
bottom of the slide centrally aligned. I don't seem to be able to do
this using:
shapeRng.align msoMiddles, true
What am I doing wrong, or is there a better way?

Much appreciated.
Alex
 
T

Tushar Mehta

How does it not work? What code does PP generate if you use the macro
recorder?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
H

haroldk

Try using the Left and Top properties of the Shape.
I'm not certain the values but this will move the graph
Sub setPosition()
Dim oShape As Shape
Set oShape = ActivePresentation.Slides(1).Shapes(1)
With oShape
.Left = 250
.Top = 225
End With
End Sub
 
M

mcalex

How does it not work? What code does PP generate if you use the macro
recorder?
This:
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=2.
and I don't know what Verb #2 is, or how to Do it :)

I have seen HaroldK's post below and managed to manipulate the chart
using similar syntax.
Thx
Alex
 
M

mcalex

haroldk said:
Try using the Left and Top properties of the Shape.
I'm not certain the values but this will move the graph
Sub setPosition()
Dim oShape As Shape
Set oShape = ActivePresentation.Slides(1).Shapes(1)
With oShape
.Left = 250
.Top = 225
End With
End Sub

--
Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
(e-mail address removed)

--
Thank you Harold. Not sure what I was doing wrong before, but I used
similar syntax to yours and managed to get a (correct) reference to a
ShapeRange and therefore was able to convince Ppt use the Align method
properly.

Thank you
Alex
 

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