There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Business Applications
Tag Cloud
acer backup bios boot bsod computer connection crash dell desktop display driver drivers email error excel firefox format freeze hard drive hardware hijackthis internet kb977165 keyboard laptop linksys mac malware network outlook outlook 2003 outlook 2007 problem recovery slow sound toshiba trojan usb video virus vista vpn windows windows 7 windows vista windows xp wireless youtube
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Hi to all my old friends, and intro to any new ones!!!!

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 11:16 AM #1
Solved: Hi to all my old friends, and intro to any new ones!!!!
If you dont already know me....

My name is Red and have been working with VBA for a couple years, with mainly the PPT and word object models...

If you have any questions about it please drop me a line! I have been away from this forum for a bit but am back hopfully for good. My distractions have been around learning Lectora and a few other eLearning apps, but have come full circle and am back to some of my original ideas about making an Auto Suite of my own and basing my new company around some new products I have been working on for about 5 years now....!

with that said... let's get to it!

I have two questions I am looking to discuss over the next couple weeks....

1. Does anybody know how to grab a graphic off of a PPT slide and copy it to a selected folder?

2. Does anybody know if I can set up delimited areas in the notes section of PPT and copy/paste them into a bookmarked area of a word doc??? I already have the code working to copy/paste text from the slide to a .doc..... needing help with the delimited notes part....

Glad to be back in the mix!
Red
etaf's Avatar
Computer Specs
Moderator with 21,447 posts.
 
Join Date: Oct 2003
Location: Surrey, UK
Experience: Intermediate
02-Nov-2009, 11:23 AM #2
1) i would click on it - copy and then paste into paint and save
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 11:25 AM #3
Thanks for the post...
I am looking for a automated VBA solution, but thanks for the post!
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,861 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Nov-2009, 11:38 AM #4
Can you post an Example of what you want to do (in both cases), not that I know much PPT VBA.
JohnWilson's Avatar
Computer Specs
Senior Member with 158 posts.
 
Join Date: Nov 2007
Experience: Advanced
02-Nov-2009, 12:43 PM #5
Red

You will need to use the Shape.Export(path,format,width,height) method to export as a picture format

It's a hidden method so you will need to open the object browser > Right click > Show Hidden Members
DaveA's Avatar
Distinguished Member with 5,140 posts.
 
Join Date: Nov 1999
Experience: Advanced
02-Nov-2009, 12:43 PM #6
Also you might try "Save As" and select a image type, and then the wizard may ask if you for the current or all slides.

It does for me in PowerPoint 2003 and 2007!
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 12:44 PM #7
Code...
Sub ExportSlideGraphics()
Dim ExportPath As String ' drive:\path to export to
Dim oSlide As Slide


ExportPath = "C:\Graphics"

Set oSlide = ActivePresentation.Slides 'getting an error here....
With oSlide
.Export ExportPath & "Slide" & CStr(.SlideIndex) & ".JPG", "JPG"
End With

End Sub
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 12:45 PM #8
...
this is the code I am playing with to save slide images to path folder - above ||||
JohnWilson's Avatar
Computer Specs
Senior Member with 158 posts.
 
Join Date: Nov 2007
Experience: Advanced
02-Nov-2009, 12:51 PM #9
Red

That will (if you set oslide properly) export the whole slide as a jpg. Is that what you need?
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 12:56 PM #10
no no - but i do see what you are saying with this:

Sub Export(PathName As String, Filter As PpShapeFormat, [ScaleWidth As Long], [ScaleHeight As Long], [ExportMode As PpExportMode = ppRelativeToSlide])

Const ppShapeFormatPNG = 2

End Sub


just need help filling it out to match the above path...
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 01:58 PM #11
i HAVE MADE A NEW THREAD TO HANDLE THE QUESTION #2 PLEASE USE IT TO ANSWER...
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 03:25 PM #12
Gezz I havent written VBA in a year or so... I am rusty but this is close to what I want...


Sub ExportSlideGraphics()
Dim x As Long
Dim y As Long
Dim i As Integer
Dim objText As Object


i = 1

For x = 1 To ActivePresentation.Slides.Count
For y = 1 To ActivePresentation.Slides(x).Shapes.Count


If ActivePresentation.Slides(x).Shapes(y).Type = Shapes Then


Call ActiveWindow.Selection.ShapeRange(1).Export( _
"C:\Graphics\filename" & x & ".jpg", _
ppShapeFormatJPG)
End If


Next x
Next y


End Sub
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,753 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
02-Nov-2009, 04:38 PM #13
All, this is something I found online (forget where, sorry someone) that I sent to Red in a private message:
Code:
Call ActiveWindow.Selection.ShapeRange(1).Export( _
	"C:\Workarea\filename.gif", _
	ppShapeFormatGIF)
The same page says:
"Use .ShapeRange.Export instead of .ShapeRange(1).Export to export the entire current selection to a graphics file. There will be a white or black background between shapes, regardless of what your presentation's background might be."
And, of course, you can choose another format (.jpg, .png) rather than .gif.

I think that code should be easier than looping to the Next one.[
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
02-Nov-2009, 08:24 PM #14
I think this is pretty close to what I need, but its not outputing any graphic.?!?!? But Im not getting any errors either...

Sub export_pic()
Dim osld As Slide
Dim oshp As Shape
Dim strPath As String
strPath = "C:\Graphics"
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoPicture Then
oshp.Export strPath & "Slide " & CStr(osld.SlideIndex) & "Pic.png", ppShapeFormatPNG

End If
Next oshp
Next osld
End Sub
Red2034's Avatar
Computer Specs
Senior Member with 157 posts.
 
Join Date: Apr 2007
Location: Seattle, WA
Experience: Flash Guru - VBA.... still learning
03-Nov-2009, 12:13 AM #15
Sub ExtractImages()
On Error GoTo ErrorExtract
Dim oPres As Presentation
Dim oSldSource As Slide
Dim oShpImg As ShapeRange
Dim oShpSource As Shape
Dim oSld As Slide
Dim oShp As Shape
Dim Ctr As Integer
Dim sPath As String

sPath = "C:\Temp\"


Ctr = 0
For Each oSldSource In ActivePresentation.Slides
For Each oShpSource In oSldSource.Shapes
If oShpSource.Type = msoPicture Then

Set oShp = oShpSource
Set oPres = Presentations.Add(False)
With oPres.PageSetup
.SlideSize = ppSlideSizeCustom
.SlideHeight = oShp.Height
.SlideWidth = oShp.Width
End With
Set oSld = oPres.Slides.Add(1, ppLayoutBlank)
oShp.Copy
Set oShpImg = oSld.Shapes.Paste
With oShpImg
.Left = 0
.Top = 0
End With
Ctr = Ctr + 1
Call oSld.Export(sPath & "Img" & Format(Ctr, "00000") & ".JPG", "JPG")
oPres.Close
End If
Next oShpSource
Next oSldSource
If Ctr = 0 Then
MsgBox "There were no images found in this presentation", _
vbInformation, "Image extraction failed."
End If
Exit Sub
ErrorExtract:
If Err.Number <> 0 Then
MsgBox Err.Description, vbCritical, "Error #" & Err.Number
End If
End Sub
Closed Thread Bookmark and Share   techguy.org/873810

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:27 AM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by Cermak Technologies, Inc.