Consulting

Results 1 to 8 of 8

Thread: On double click re size image to size of slide

  1. #1
    VBAX Regular
    Joined
    Nov 2013
    Posts
    7
    Location

    On double click re size image to size of slide

    Hi all - First time poster.

    Many thanks for any replies.

    I have a lot of images in PowerPoint most of which need to be re sized and at the moment Im doing this manually...

    Is there a way in VBA I can say:

    "If I double click on an image re size that image to fit the current slide size".

    I am using PP 2010.

    There is only ever 1 image per slide if i coudl double click an image and it auto fitted to the slide size that would be a great time saver but Im not sure if this is even possible can anyone help or give me a kick in the right direction?

    Thanks everyone.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    There's no simple way to make a double click do that. You could write an AddIn that adds a size to full slide on the ribbon or if you are a good coder add a right click option.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Nov 2013
    Posts
    7
    Location
    Thanks for the reply John - I actually have no coding skills what so ever in PowerPoint. But have some basic excel knowledge. I like the idea of an Add-in? Even a short cut key as oppose to a double click would be useful to me, Is assigning a short cut key a possibility?

  4. #4
    VBAX Regular
    Joined
    Nov 2013
    Posts
    7
    Location
    Just had a quick scan through the link in your Bio and I've actually found a Macro which is just what I need and seems to work for me.

    Sub Pic_Size()
    'resize selection to full page
    'note may distort image
    Dim oshp As Shape
    If ActiveWindow.Selection.Type <> ppSelectionShapes Then Exit Sub
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    With oshp
    .LockAspectRatio = False
    .Height = ActivePresentation.PageSetup.SlideHeight
    .Width = ActivePresentation.PageSetup.SlideWidth
    .Left = 0
    .Top = 0
    End With
    End Sub
    If I can assign a short cut key to this, this would be exactly what I needed. Thanks

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    OK. As it happens we already have in house code for this.

    Download the pptm file here. You can check out the function by right clicking the image and seeing the new entry in the menu. There is hidden XML code as well as the vba you can see.

    To make it into an AddIn if it's what you need.

    Save As but choose type= *.ppam AddIn

    Save in the default folder that opens.

    If you do not have the DEVELOPER Tab visible enable from File > Options > Customise Ribbon ansd tick DEVELOPER in the Right pane

    Now choose DeVELOPER > AddIns and Add New > Choose Right.ppam

    All done

    Oh you cannot create shortcut keys in PPT and NO you can't borrow Antonia!

    The code in the link will distort images the code here won't.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Regular
    Joined
    Nov 2013
    Posts
    7
    Location
    John, many thanks for this looks great I understand your instructions but I have a problem (It might not be related to the macro could just be me)

    When I save as a PPAM straight away I get PowerPoint is not responding and eventually crashes

    Anyway I've tested this on a colleagues machine and it works great.

    Many thanks for taking the time to reply

  7. #7
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Do you have Kaspersky virus checker??

    If so that's the problem.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  8. #8
    That's good i appreciate your information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •