Follow
Share
Bookmark and Share
Translate












Like This Page?
Like This Site?



Product Showcase






PowerPoint Programming

Everything about PowerPoint programming including VBA, VSTO, and more.


Friday, March 20, 2009
posted by Geetesh at Friday, March 20, 2009 IST

Note: If you don't know how to use macro snippets or scripts inside PowerPoint, look here...

This started with my Create Spirograph in PowerPoint tutorial -- and thanks to my friend Shyam Pillai who said I could do that so much faster programattically by using this code:

Sub CreateSpirograph()
Dim oShp As Shape
Dim I As Single

Const ROTATION_INCREMENT = 5 'Rotation Increment
Const ROTATION_MAX = 360 'Max rotation

'Select a shape on the slide and then run this
Set oShp = ActiveWindow.Selection.ShapeRange(1)

For I = ROTATION_INCREMENT To ROTATION_MAX Step ROTATION_INCREMENT
With oShp.Duplicate
.Rotation = I
.Left = oShp.Left
.Top = oShp.Top
End With
Next
End Sub

Remember you need to have some shape selected before you run this code. Also, Shyam adds that you can change the ROTATION_INCREMENT and ROTATION_MAX values to get different graphs.

Shyam Pillai is a Microsoft PowerPoint MVP, visit his site for many VBA snippets, free and commercial PowerPoint add-ins

Labels: , , , ,

0 comments

Links to this post



Comments:

Post a Comment

Links to this post:

Create a Link

    follow me on Twitter

    Archives:

    March 2009  |  April 2009  |  April 2010  |  

    Featured Story

    iPad Presenting 07: Wired iPad to VGA with the Apple Digital AV Adapter

    iPad Presenting 07: Wired iPad to VGA with the Apple Digital AV AdapterSo much about presenting with an iPad depends upon how you can send the visual signals from your iPad to the projector or television outputs. We have already established that the wireless way of connecting the iPad to an output is far superior since it lets you hold the iPad in your hand and control your slides wirelessly – that way you are free to move around in your presentation venue – more often than not this approach requires an in-between device such as an Apple TV 2. What we have not discussed so far is how you can use a wired option that lets you cable your iPad directly to an output such as a VGA capable projector or television.

    Learn about how you can use the Apple Digital AV Adapter with your iPad.

        
    Featured Book

    PowerPoint 2007 Complete Makeover Kit

    PowerPoint 2007 Complete Makeover Kit
    PowerPoint 2007 Complete Makeover Kit is out! Check the book on Amazon.com...

    And here are some free excerpts...


    Home | PowerPoint | Photoshop | Free PowerPoint Templates | Blog | Notes | Ezine | Studio | Advertise | Feedback | Site Map | About Us | Contact Us
    Link to Us | RSS | Privacy | Testimonials
    Free PowerPoint Backgrounds | Free Christian PowerPoint Backgrounds | Free Business PowerPoint Presentation Templates

    Plagiarism will be detected by Copyscape


      ©2000-2012, Geetesh Bajaj. All rights reserved.

        since November 02, 2000