Consulting

Results 1 to 16 of 16

Thread: 2003 macro want work in 2007 powerpoint

  1. #1
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location

    2003 macro want work in 2007 powerpoint

    I have 2007 power point now, in 2003 I could record a macro, but in 2007 ppt I cannot seem to find the control to record a macro and learned there is none?

    The below macro worked in 2003, but does not work in 2007, its a simple fit to page function:

    ActiveWindow.Selection.ShapeRange.ScaleWidth 1, msoFalse, msoScaleFromBottomRight
    ActiveWindow.Selection.ShapeRange.ScaleHeight 1, msoFalse, msoScaleFromBottomRight
    ActiveWindow.Selection.ShapeRange.ScaleWidth 1, msoFalse, msoScaleFromTopLeft
    ActiveWindow.Selection.ShapeRange.ScaleHeight 1, msoFalse, msoScaleFromTopLeft
    End Sub

    Basically I copy a pdf file into ppt and want to expand it to a defined outline I already have created in ppt.

    Any help here?

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    What did you expect it to do?

    Scaling by a factor of 1 usually does nothing.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    It did in ppt 2003 fit pdf import to outline in ppt................

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    ScaleHeight 1 and ScaleWidth1 just set the height and width to the original height / Width x 1.

    Here's the Object Model Entry
    Shape.ScaleWidth Method
    Scales the width of the shape by a specified factor. For pictures and OLE objects, you can indicate whether you want to scale the shape relative to the original size or relative to the current size. Shapes other than pictures and OLE objects are always scaled relative to their current width.
    Syntax

    expression.ScaleWidth(Factor, RelativeToOriginalSize, fScale)

    expression A variable that represents a Shape object.

    Parameters

    Name Required/Optional Data Type Description

    Factor Required Single Specifies the ratio between the width of the shape after you resize it and the current or original width. For example, to make a rectangle 50 percent larger, specify 1.5 for this argument.

    RelativeToOriginalSize Required MsoTriState Specifies whether a shape is scaled relative to its current or original size.

    fScale Optional MsoScaleFrom The part of the shape that retains its position when the shape is scaled.


    If you saw something different in 2003 it was probably the different behaviour of placeholders.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    [VBA]Sub TEST()
    expression.ScaleWidth(Factor, RelativeToOriginalSize, fScale)
    expression A variable that represents a Shape object.
    End Sub[/VBA]

    I could not get to work, I can send you the ppt, its basically a pdf copied into a ppt slide.

    IN 2003 I just recored the above macro and it auto fit every slide

  6. #6
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    Does anyone here know a good Powerpoint forum website where there are good amount of users and pros discussing and solving ppt 2007 issues? Thanks in advance for the tip.

  7. #7
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    This is really not meant to be offensive.

    Your Sub Test seems to indicate that you don't really understand code!

    Have you considered:

    Explaining exactly what you need to do
    (forgetting the code you have so far)

    Pretty sure one of the pros here will supply the code you need!
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  8. #8
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    Not to be offensive either, but you seem to be the only one on this site as it moves slowly, maybe I am missing something.

    I write code all the time, but mostly in eXcEl............

    The 2003 code is pretty simple, it expands an import file that is well copied into ppt, when you copy a file into ppt, it maintains its origin size and in this case from pdf.....

    Like I said in an earlier post, I can send you the ppt file, not sure I could explain much more than this with providing the original code that worked in ppt 2003, I used this code for many years, but it does NOT work in 2007, in excel VBA 2003 code has to be altered for 2007 usage in some cases, the tweeks for excel I know, the tweeks for ppt I figured I'd try a forum...........otherwise I will have to invest a few hours to figure out myself, which I have already invested some time here with you(not to offend you), but can you or can't you, either way I am good, just cannot go back and forth again............time is money ya know mate..............

  9. #9
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    I'll leave you to it then. For the record though I write Excel and PowerPoint code for multinationals all over the world and change Łthree figures / hour but as I said I'll leave you to it. As you (nearly) said your time is my money.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  10. #10
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    I figured such a response from you, is 3 figures an hour something to brag about my friend, what a pitty for you, haha........?????????

  11. #11
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Yep And I figured your response too!
    I wasn't bragging BTW just pointing out I was trying to help someone who doesn't know how to code and doesn't listen for free
    You may now have the last word.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  12. #12
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    4 minutes 32 seconds:

    Dim shp As ShapeRange
    If ActiveWindow.Selection.Type = ppSelectionShapes Then
    Set shp = ActiveWindow.Selection.ShapeRange
    shp.Left = 0
    shp.Top = 0
    shp.Height = ActivePresentation.PageSetup.SlideHeight
    shp.Width = ActivePresentation.PageSetup.SlideWidth
    End If
    Set shp = Nothing


    ps Get a new Gig mate !!!

  13. #13
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Yep, PetLahev CAN code. That's the correct code for 2003 too.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  14. #14
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    I noticed though that you are now saying it didn't work.
    This is almost certainly because of the code you are using before Pet's code not leaving a selection active.

    Try:
    [vba]Dim oshp As Shape
    Dim osld As Slide
    Set osld = ActiveWindow.View.Slide
    Set oshp = osld.Shapes(osld.Shapes.Count)
    oshp.Left = 0
    oshp.Top = 0
    oshp.Height = ActivePresentation.PageSetup.SlideHeight
    oshp.Width = ActivePresentation.PageSetup.SlideWidth
    Set oshp = Nothing
    Set osld = Nothing[/vba]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  15. #15
    VBAX Regular
    Joined
    Dec 2011
    Posts
    8
    Location
    my 03 code did all pages auto-fit to an outline, not the hole page, this code does one to page and the 1 has 2 B highlighted.....my code not posted complete of all MAHT.

    NO big deal...I got it to work.......

  16. #16
    VBAX Newbie
    Joined
    Dec 2011
    Posts
    3
    Location
    PowerPoint Viewer 2007 lets you view full-featured presentations created in PowerPoint 97 and later versions. This viewer also supports opening password-protected Microsoft PowerPoint presentations. You can view and print presentations, but you cannot edit them in the PowerPoint Viewer 2007.

Posting Permissions

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