A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

can i use a macro to auto resize a pic?



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2008, 02:34 PM posted to microsoft.public.powerpoint
theintern
external usenet poster
 
Posts: 58
Default can i use a macro to auto resize a pic?

I need a macro to autoresize a pic to fill up as much of the top half
(approximately) of a slide as possible. Is there a way to do this?

thanks
scott
  #2  
Old July 8th, 2008, 03:53 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default can i use a macro to auto resize a pic?

In article , Theintern
wrote:
I need a macro to autoresize a pic to fill up as much of the top half
(approximately) of a slide as possible. Is there a way to do this?


Have a look at the free PPTools StarterSet add-in

http://www.pptools.com/starterset/

It includes a couple of buttons that can do this for you automatically.

You create a rectangle that defines the target area you want to size things
into and memorize its position/size. Then delete it.

Then you can use the "hammer" button to make any other shape fit into that
defined/memorized area (as large as possible w/o distortion or simply as large
as possible, distorted or not, your choice)

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


  #3  
Old July 8th, 2008, 04:15 PM posted to microsoft.public.powerpoint
theintern
external usenet poster
 
Posts: 58
Default can i use a macro to auto resize a pic?

How do I "use the "hammer" button to make any other shape fit into that
defined/memorized area"? Each time i click on it, it tells me i need to
select an object. How do i define the area i want it to fill?

thanks
scott

"Steve Rindsberg" wrote:

In article , Theintern
wrote:
I need a macro to autoresize a pic to fill up as much of the top half
(approximately) of a slide as possible. Is there a way to do this?


Have a look at the free PPTools StarterSet add-in

http://www.pptools.com/starterset/

It includes a couple of buttons that can do this for you automatically.

You create a rectangle that defines the target area you want to size things
into and memorize its position/size. Then delete it.

Then you can use the "hammer" button to make any other shape fit into that
defined/memorized area (as large as possible w/o distortion or simply as large
as possible, distorted or not, your choice)

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



  #4  
Old July 8th, 2008, 04:21 PM posted to microsoft.public.powerpoint
theintern
external usenet poster
 
Posts: 58
Default can i use a macro to auto resize a pic?

I may have it figured out now, but i need it in a macro, and thanks to there
being no recording tool, and my complete lack of VBA, you know what lines of
code would allow for the picture just pasted to a slide to then be auto
resized to that shape? you can assume the pic is already pasted. i just
need the code to resize it.

thanks
scott

"Steve Rindsberg" wrote:

In article , Theintern
wrote:
I need a macro to autoresize a pic to fill up as much of the top half
(approximately) of a slide as possible. Is there a way to do this?


Have a look at the free PPTools StarterSet add-in

http://www.pptools.com/starterset/

It includes a couple of buttons that can do this for you automatically.

You create a rectangle that defines the target area you want to size things
into and memorize its position/size. Then delete it.

Then you can use the "hammer" button to make any other shape fit into that
defined/memorized area (as large as possible w/o distortion or simply as large
as possible, distorted or not, your choice)

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



  #5  
Old July 8th, 2008, 08:41 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default can i use a macro to auto resize a pic?

In article , Theintern wrote:
I may have it figured out now, but i need it in a macro, and thanks to there
being no recording tool, and my complete lack of VBA, you know what lines of
code would allow for the picture just pasted to a slide to then be auto
resized to that shape? you can assume the pic is already pasted. i just
need the code to resize it.


Assuming the shape is also selected, you can do something like:

With ActiveWindow.Selection.ShapeRange(1)
' this will be true or false depending on what
' you're after:
.LockAspectRatio = msoFalse
' set the size/position
.Left = xx
.Top = xx
.Height = xx
.Width = xx
End With

You'd need to calculate the values for each parameter. If you don't care whether
the shape is distorted or not, so long as it fits your target area, then just use
the left, top, height and width of your target area directly. In that case, also
set .LockAspectRatio to msoFalse




thanks
scott

"Steve Rindsberg" wrote:

In article , Theintern
wrote:
I need a macro to autoresize a pic to fill up as much of the top half
(approximately) of a slide as possible. Is there a way to do this?


Have a look at the free PPTools StarterSet add-in

http://www.pptools.com/starterset/

It includes a couple of buttons that can do this for you automatically.

You create a rectangle that defines the target area you want to size things
into and memorize its position/size. Then delete it.

Then you can use the "hammer" button to make any other shape fit into that
defined/memorized area (as large as possible w/o distortion or simply as large
as possible, distorted or not, your choice)

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================





-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


  #6  
Old July 8th, 2008, 10:14 PM posted to microsoft.public.powerpoint
theintern
external usenet poster
 
Posts: 58
Default can i use a macro to auto resize a pic?

works beautifully. Thanks!

"Steve Rindsberg" wrote:

In article , Theintern wrote:
I may have it figured out now, but i need it in a macro, and thanks to there
being no recording tool, and my complete lack of VBA, you know what lines of
code would allow for the picture just pasted to a slide to then be auto
resized to that shape? you can assume the pic is already pasted. i just
need the code to resize it.


Assuming the shape is also selected, you can do something like:

With ActiveWindow.Selection.ShapeRange(1)
' this will be true or false depending on what
' you're after:
.LockAspectRatio = msoFalse
' set the size/position
.Left = xx
.Top = xx
.Height = xx
.Width = xx
End With

You'd need to calculate the values for each parameter. If you don't care whether
the shape is distorted or not, so long as it fits your target area, then just use
the left, top, height and width of your target area directly. In that case, also
set .LockAspectRatio to msoFalse




thanks
scott

"Steve Rindsberg" wrote:

In article , Theintern
wrote:
I need a macro to autoresize a pic to fill up as much of the top half
(approximately) of a slide as possible. Is there a way to do this?

Have a look at the free PPTools StarterSet add-in

http://www.pptools.com/starterset/

It includes a couple of buttons that can do this for you automatically.

You create a rectangle that defines the target area you want to size things
into and memorize its position/size. Then delete it.

Then you can use the "hammer" button to make any other shape fit into that
defined/memorized area (as large as possible w/o distortion or simply as large
as possible, distorted or not, your choice)

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================





-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.