If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Resizing imported PowerPoint slides
I have projects where I import PowerPoint slides into a table no Word.
One slide per row. In order to fit our standardized format, I have to resize the slides (shrink them down). I currently do this by resizing each slide one at a time. Is there any way to select all the slides in a tabe at once and resize them? |
#2
|
|||
|
|||
Resizing imported PowerPoint slides
Let me clear this up a bit. I import the slide INTO word.
I'm trying to figure out how to resize all the imported slides at once reather than going to each table cell and resizing. (Next time I'll proof-read my question!) "ctrhippie" wrote: I have projects where I import PowerPoint slides into a table no Word. One slide per row. In order to fit our standardized format, I have to resize the slides (shrink them down). I currently do this by resizing each slide one at a time. Is there any way to select all the slides in a tabe at once and resize them? |
#3
|
|||
|
|||
Resizing imported PowerPoint slides
"ctrhippie" wrote:
Let me clear this up a bit. I import the slide INTO word. I'm trying to figure out how to resize all the imported slides at once reather than going to each table cell and resizing. I assume that the PowerPoint objects are inline with text in the cells. If that is the case, use this macro. Just change "sngNewHeight" to the value (in inches) that you need for the height of the slides in Word. In this code the value is 2.5 inches. Sub ResizePowerPoint() Dim tblPower As Table Dim rgeTable As Range Dim inshpPower As InlineShape Dim sngOldHeight As Single Const sngNewHeight As Single = 2.5 If ActiveDocument.Tables.Count 0 Then For Each tblPower In ActiveDocument.Tables Set rgeTable = tblPower.Range If rgeTable.InlineShapes.Count 0 Then For Each inshpPower In rgeTable.InlineShapes With inshpPower sngOldHeight = .Height .Height = InchesToPoints(sngNewHeight) .Width = InchesToPoints(((.Width * sngNewHeight) / sngOldHeight)) End With Next End If Next Else MsgBox "There are no tables in this document.", _ vbExclamation, "Cancelled" End If End Sub |
#4
|
|||
|
|||
Resizing imported PowerPoint slides
This is a nippy bit of maco.
One question, how would it look if it changed the size of multiple images not in a table? Many thanks DeanH "Jean-Guy Marcil" wrote: "ctrhippie" wrote: Let me clear this up a bit. I import the slide INTO word. I'm trying to figure out how to resize all the imported slides at once reather than going to each table cell and resizing. I assume that the PowerPoint objects are inline with text in the cells. If that is the case, use this macro. Just change "sngNewHeight" to the value (in inches) that you need for the height of the slides in Word. In this code the value is 2.5 inches. Sub ResizePowerPoint() Dim tblPower As Table Dim rgeTable As Range Dim inshpPower As InlineShape Dim sngOldHeight As Single Const sngNewHeight As Single = 2.5 If ActiveDocument.Tables.Count 0 Then For Each tblPower In ActiveDocument.Tables Set rgeTable = tblPower.Range If rgeTable.InlineShapes.Count 0 Then For Each inshpPower In rgeTable.InlineShapes With inshpPower sngOldHeight = .Height .Height = InchesToPoints(sngNewHeight) .Width = InchesToPoints(((.Width * sngNewHeight) / sngOldHeight)) End With Next End If Next Else MsgBox "There are no tables in this document.", _ vbExclamation, "Cancelled" End If End Sub |
#5
|
|||
|
|||
Resizing imported PowerPoint slides
"DeanH" wrote:
This is a nippy bit of maco. One question, how would it look if it changed the size of multiple images not in a table? Many thanks Something like this (untested). But this only works on inlinehapes. You would need another routine if you also have floating shapes. Of course, if you only have floating shapes, you would need different code. Sub ResizePowerPoint() Dim inshpPower As InlineShape Dim sngOldHeight As Single Const sngNewHeight As Single = 2.5 With ActiveDocument If .InlineShapes.Count 0 Then For Each inshpPower In .InlineShapes With inshpPower sngOldHeight = .Height .Height = InchesToPoints(sngNewHeight) .Width = InchesToPoints(((.Width * sngNewHeight) / sngOldHeight)) End With Next Else MsgBox "There are no shapes in this document.", _ vbExclamation, "Cancelled" End If End With End Sub |
#6
|
|||
|
|||
Resizing imported PowerPoint slides
Many thanks for this.
As I don't often use floating shapes, I don't foresee any problems. I shall have a play later. Thanks again. DeanH "Jean-Guy Marcil" wrote: "DeanH" wrote: This is a nippy bit of maco. One question, how would it look if it changed the size of multiple images not in a table? Many thanks Something like this (untested). But this only works on inlinehapes. You would need another routine if you also have floating shapes. Of course, if you only have floating shapes, you would need different code. Sub ResizePowerPoint() Dim inshpPower As InlineShape Dim sngOldHeight As Single Const sngNewHeight As Single = 2.5 With ActiveDocument If .InlineShapes.Count 0 Then For Each inshpPower In .InlineShapes With inshpPower sngOldHeight = .Height .Height = InchesToPoints(sngNewHeight) .Width = InchesToPoints(((.Width * sngNewHeight) / sngOldHeight)) End With Next Else MsgBox "There are no shapes in this document.", _ vbExclamation, "Cancelled" End If End With End Sub |
#7
|
|||
|
|||
Resizing imported PowerPoint slides
This works perfectly.
I swapped the Height and Width as I want the width to be the controlling factor. Also changed the InchesToPoints to CentimetersToPoints, no problems at all. Many thanks Jean-Guy. Have a nice day. DeanH "DeanH" wrote: Many thanks for this. As I don't often use floating shapes, I don't foresee any problems. I shall have a play later. Thanks again. DeanH "Jean-Guy Marcil" wrote: "DeanH" wrote: This is a nippy bit of maco. One question, how would it look if it changed the size of multiple images not in a table? Many thanks Something like this (untested). But this only works on inlinehapes. You would need another routine if you also have floating shapes. Of course, if you only have floating shapes, you would need different code. Sub ResizePowerPoint() Dim inshpPower As InlineShape Dim sngOldHeight As Single Const sngNewHeight As Single = 2.5 With ActiveDocument If .InlineShapes.Count 0 Then For Each inshpPower In .InlineShapes With inshpPower sngOldHeight = .Height .Height = InchesToPoints(sngNewHeight) .Width = InchesToPoints(((.Width * sngNewHeight) / sngOldHeight)) End With Next Else MsgBox "There are no shapes in this document.", _ vbExclamation, "Cancelled" End If End With End Sub |
#8
|
|||
|
|||
Resizing imported PowerPoint slides
"DeanH" wrote:
This works perfectly. I swapped the Height and Width as I want the width to be the controlling factor. Also changed the InchesToPoints to CentimetersToPoints, no problems at all. Many thanks Jean-Guy. Have a nice day. Glad I could help... you too! (have a nice day) |
Thread Tools | |
Display Modes | |
|
|