Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / February 2007

Tip: Looking for answers? Try searching our database.

Scaling and unscaling a rectangle (not picture or OLE)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
flying_pig - 14 Feb 2007 17:02 GMT
Is there a method or simple way of scaling up (say to 1.1) a simple rectangle
then returning it back to original size?

e.g. to animate a button where the built-in animation is not
suitable/unavailable.

If feel sure this is quite simple but am grateful for a steer.

Bob L
John Wilson - 14 Feb 2007 17:16 GMT
Apply an emphasis > grow shrink animation.
Set a custom zoom of 110% and press ENTER to confirm (make sure you press
enter or the default will come back)
Now double click the entry in custom animation and tick auto reverse. You
might want to trigger the animation with a click on itself.
Signature

--------------------------------------------
Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk

> Is there a method or simple way of scaling up (say to 1.1) a simple rectangle
> then returning it back to original size?
[quoted text clipped - 5 lines]
>
> Bob L
flying_pig - 14 Feb 2007 17:32 GMT
John,

Unfortunately any attempt to use built-in animation effects are disabled as
all of the shapes are within groups. At this late stage I can neither afford
to ungroup them or turn them into pictures (although I would if starting from
scratch).

I tried to use Scaleheight / ScaleWidth but cannot set the unscale value
accurately enough and the shape either grows or shrinks following repeated
cycling (keypresses on the object that runs the scaling macro).

Any thoughts.

> Apply an emphasis > grow shrink animation.
> Set a custom zoom of 110% and press ENTER to confirm (make sure you press
[quoted text clipped - 11 lines]
> >
> > Bob L
Steve Rindsberg - 15 Feb 2007 03:21 GMT
> John,
>
[quoted text clipped - 6 lines]
> accurately enough and the shape either grows or shrinks following repeated
> cycling (keypresses on the object that runs the scaling macro).

Here's one approach to a VBA solution (if you can use that)

Sub PumpMeUp()
   
   With ActiveWindow.Selection.ShapeRange(1)
       .Tags.Add Name:="Height", Value:=CStr(.Height)
       .Tags.Add Name:="Width", Value:=CStr(.Width)
       .Height = .Height * 1.1
       .Width = .Width * 1.1
   End With

End Sub

Sub DeflateMe()

   With ActiveWindow.Selection.ShapeRange(1)
       .Height = CSng(.Tags("Height"))
       .Width = CSng(.Tags("Width"))
   End With
   
End Sub

' You can use this to test it:

Sub BingePurgeMe()
   Dim x As Long
   With ActiveWindow.Selection.ShapeRange(1)
       For x = 1 To 100
           PumpMeUp
           DeflateMe
       Next
   End With
End Sub

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
John Wilson - 15 Feb 2007 15:00 GMT
Based on Steve's code (which works in edit mode only) this would work only in
show mode (after youve used Steve's code to add the tags) and toggle between
pumped and whatever the opposite of pumped is! Give the shape an action
setting of run macro
'__ start
Sub PumpMeUpanddown(oshp As Shape)
With oshp
Select Case .Tags("height")
Case Is = CStr(.Height)
.Tags.Add Name:="Height", Value:=CStr(.Height)
.Tags.Add Name:="Width", Value:=CStr(.Width)
.Height = .Height * 1.1
.Width = .Width * 1.1
Case Is <> CStr(.Height)
.Height = CSng(.Tags("Height"))
.Width = CSng(.Tags("Width"))
End Sub
'__end
--------------------------------------------
Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk

> > John,
> >
[quoted text clipped - 46 lines]
> PPTools:  www.pptools.com
> ================================================
John Wilson - 15 Feb 2007 15:49 GMT
OOps missed a bit in the copy/paste!

Sub PumpMeUpanddown2(oshp As Shape)
With oshp
Select Case .Tags("height")
Case Is = CStr(.Height)
.Tags.Add Name:="Height", Value:=CStr(.Height)
.Tags.Add Name:="Width", Value:=CStr(.Width)
.Height = .Height * 1.1
.Width = .Width * 1.1
Case Is <> CStr(.Height)
.Height = CSng(.Tags("Height"))
.Width = CSng(.Tags("Width"))
End Select
End With
End Sub
Signature

--------------------------------------------
Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk

> Based on Steve's code (which works in edit mode only) this would work only in
> show mode (after youve used Steve's code to add the tags) and toggle between
[quoted text clipped - 69 lines]
> > PPTools:  www.pptools.com
> > ================================================
flying_pig - 18 Feb 2007 13:49 GMT
John,

This worked ok and I can use it as is thanks.  Always wanting a little more
I would have liked the scaling origin to be the middle of the shape but I
guess that is slightly more difficult?

> OOps missed a bit in the copy/paste!
>
[quoted text clipped - 86 lines]
> > > PPTools:  www.pptools.com
> > > ================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.