
Re-arrange this code so it works
Quote:
> Selection.ShapeRange
is represented by the object variable "shp" in the
macro (the one that wasn't recorded)
So whenever a Selection.ShapeRange is there in yr recorded
macro, you can implement "shp" instead
Going a step further
Quote:
> shp.WrapFormat
equals
> Selection.ShapeRange.WrapFormat
or
Quote:
> shp.Fill
equals
> Selection.ShapeRange.Fill
The recorded macro uses a Selection object to indicate
the Shape y're addressing, where as the code provided
to you by other persons (Cindy wasn't it?) refer to
the object itself ...
Try to figure this out, good luck
Krgrds,
Perry
Quote:
> Hi,
> Please can someone help me here, the imaging for this
> report template is driving me to drink!!
> The code below has been taken from a macro that I
> recorded that seemed to give me the result I wanted when
> formatting a shape.
> How can I get this "into" my existing bit of code that was
> put together with help of some fine people on this site.
> The existing code:- This converts my images to shapes
> (which I want to do) but makes them disappear off the
> screen.
> Dim ils As InlineShape
> Dim shp As Word.Shape
> 'Reduces all the pics in dimensions.
> For Each ils In ActiveDocument.InlineShapes
> ils.Fill.Visible = msoFalse
> ils.Fill.Transparency = 0#
> ils.Line.Weight = 0.75
> ils.Line.Transparency = 0#
> ils.Line.Visible = msoFalse
> ils.LockAspectRatio = msoTrue
> ils.Height = 54.44
> ils.Width = 72.54
> ils.PictureFormat.Brightness = 0.5
> ils.PictureFormat.Contrast = 0.5
> ils.PictureFormat.ColorType = msoPictureAutomatic
> ils.PictureFormat.CropLeft = 0#
> ils.PictureFormat.CropRight = 0#
> ils.PictureFormat.CropTop = 0#
> ils.PictureFormat.CropBottom = 0#
> Set shp = ils.ConvertToShape
> With shp.WrapFormat
> .Type = wdWrapSquare
> .Side = wdWrapBoth
> .DistanceTop = CentimetersToPoints(1)
> .DistanceBottom = CentimetersToPoints(1)
> .DistanceLeft = CentimetersToPoints(1)
> .DistanceRight = CentimetersToPoints(1)
> The attributes I want to apply from a recorded macro:-
> ActiveDocument.Shapes("Picture 74").Select
> Selection.ShapeRange.Fill.Visible = msoFalse
> 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 = msoFalse
> Selection.ShapeRange.LockAspectRatio = msoTrue
> Selection.ShapeRange.Height = 54.15
> Selection.ShapeRange.Width = 72.85
> Selection.ShapeRange.PictureFormat.Brightness = 0.5
> Selection.ShapeRange.PictureFormat.Contrast = 0.5
> Selection.ShapeRange.PictureFormat.ColorType =
> msoPictureAutomatic
> Selection.ShapeRange.PictureFormat.CropLeft = 0#
> Selection.ShapeRange.PictureFormat.CropRight = 0#
> Selection.ShapeRange.PictureFormat.CropTop = 0#
> Selection.ShapeRange.PictureFormat.CropBottom = 0#
> Selection.ShapeRange.RelativeHorizontalPosition = _
> wdRelativeHorizontalPositionPage
> Selection.ShapeRange.RelativeVerticalPosition = _
> wdRelativeVerticalPositionPage
> Selection.ShapeRange.Left = CentimetersToPoints(3.17)
> Selection.ShapeRange.Top = CentimetersToPoints(5.98)
> Selection.ShapeRange.LockAnchor = False
> Selection.ShapeRange.WrapFormat.AllowOverlap = True
> Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
> Selection.ShapeRange.WrapFormat.DistanceTop =
> CentimetersToPoints(1)
> Selection.ShapeRange.WrapFormat.DistanceBottom =
> CentimetersToPoints(1)
> Selection.ShapeRange.WrapFormat.DistanceLeft =
> CentimetersToPoints(1)
> Selection.ShapeRange.WrapFormat.DistanceRight =
> CentimetersToPoints(1)
> Selection.ShapeRange.WrapFormat.Type = wdWrapSquare