Inserting Picture into a Table

B

Brian

I am setting up a macro to insert a picture(JPG) into a cell
of a table. If the pic is too big for the cell, the cell
expands to accomodate the size. I want the picture to fit
exactly in the cell. There must be some way to either prevent
the cell from resizing or to specify the size of the picture
during the insert. I'm using InlineShapes.AddPicture.

Any help is greatly appreciated!
Brian
 
H

Helmut Weber

Hi Brian,

these properties of a table might help you.
Selection.Tables(1).Columns(1).PreferredWidthType
=wdPreferredWidthPoints
Selection.Tables(1).Columns(1).PreferredWidth =
CentimetersToPoints(2)
plus the according formatting for the cell-paragraph,
like
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle '!
etc...

Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word XP, NT 4.0
 
Top