Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Jacksonville,NC, USA
    Thanked 0 Times in 0 Posts
    I found a nifty piece of code that I thought could come in handy down the road, however it seems to have a snag in it as I have adjusted the path to a new folder called Test on my desktop for the image files to fall into, yet it seems they continue to drop all over my desktop instead. Could you help me troubleshoot?

    [codebox]Sub Save_PowerPoint_Slide_as_Images()

    Dim sImagePath As String
    Dim sImageName As String
    Dim oSlide As Slide '* Slide Object
    Dim lScaleWidth As Long '* Scale Width
    Dim lScaleHeight As Long '* Scale Height
    On Error GoTo Err_ImageSave

    sImagePath = "C:\Documents and Settings\padgettn\Desktop\Test"
    For Each oSlide In ActivePresentation.Slides
    sImageName = oSlide.Name & ".jpg"
    oSlide.Export sImagePath & sImageName, "JPG"
    Next oSlide

    If Err <> 0 Then
    MsgBox Err.Description
    End If
    End Sub[/codebox] need for code. Simply save as "other formats" and choose .JPG. Does the same thing. Oh well, what was I thinking?
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Thanked 7 Times in 7 Posts
    You need to put a \ at the end of the path, after Test, so it reads
    sImagePath = "C:\Documents and Settings\padgettn\Desktop\Test\"
    edited by StuartR to add
    Or even better you could replace the hard coded path to your desktop with
    sImagePath = Environ("userprofile") & "\Desktop\Test\"

Posting Permissions

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