Results 1 to 2 of 2
Thread: Problem with Code
2009-06-30, 09:47 #1
- 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?
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"
If Err <> 0 Then
Ah...no 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>
2009-06-30, 09:57 #2
- 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\"
Or even better you could replace the hard coded path to your desktop with
sImagePath = Environ("userprofile") & "\Desktop\Test\"