Consulting

Results 1 to 3 of 3

Thread: Solved: VBA insert and position 2 emfs per slide

  1. #1

    Solved: VBA insert and position 2 emfs per slide

    Hi all,

    Please could someone help me with this?

    I have multiple slides with 2 emfs (pictures) on them. On the first slide I have one emf with a filename "0001.emf" and one with a filename "0101.emf". That pattern continues on the 2nd slide (filenames "0002.emf" and "0102.emf"), 3rd slide (filenames "0003.emf" and "0103.emf") etc etc.

    What I am looking to do is justify one to the right ("0001.emf") and one to the left ("0101.emf") using a "next i" command.

    I have this as a base, which resizes and positions a single emf picture on a single slide (that someone on here kindly helped me with in the past)

    [VBA]Sub ResizeAndPosition_Charts()
    Dim i As Integer
    Dim osld As Slide
    Dim opic As ShapeRange
    For Each osld In ActivePresentation.Slides
    For i = 1 To osld.Shapes.Count
    'EMF - finds all objects with "EMF" in the Alt Text
    If UCase(Right(osld.Shapes(i).AlternativeText, 3)) = "EMF" Then
    Set opic = osld.Shapes.Range(i)
    opic.LockAspectRatio = True
    opic.Height = 320 'change to suit
    End If
    Next i
    Next osld
    End Sub[/VBA]

    Thanks for any help in advance

  2. #2
    Sorted it - changed the alt text name and used that to identify the same objects (emf) as different things

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Glad you sorted it. For future reference the Alt Text trick no longer works in version 2010.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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