resize table with macro

I

Ivano

Hi,
I have a Word document and have many many pasted objects. I selected an
Excel range then went back into Word and Paste special >link>Excel Worksheet
object.
I have recorded a macro that basically centers it, and sets the absolute
position. Howver, when I change the height and width of the Excel object the
macro doesn't record what I picked for values. It has a bunch of other
settings but on the one that will resize the table to 6" by 7". How do I
insert whatever into the macro so it will resize it???
This is the macro:

Sub Align_Center()
'
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Left = 54#
Selection.ShapeRange.Top = 187.2
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = InchesToPoints(2.6)
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
Selection.ShapeRange.WrapFormat.Type = wdWrapTopBottom

End Sub

Many thanks,
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SXZhbm8=?=,
I have a Word document and have many many pasted objects. I selected an
Excel range then went back into Word and Paste special >link>Excel Worksheet
object.
I have recorded a macro that basically centers it, and sets the absolute
position. Howver, when I change the height and width of the Excel object the
macro doesn't record what I picked for values. It has a bunch of other
settings but on the one that will resize the table to 6" by 7". How do I
insert whatever into the macro so it will resize it???
See if these lines are what you're looking for

Selection.ShapeRange.Height = InchesToPoints(7)
Selection.ShapeRange.Width = InchesToPoints(6)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top