View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
DeanH DeanH is offline
external usenet poster
 
Posts: 1,862
Default 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