Re-arrange this code so it works 
Author Message
 Re-arrange this code so it works

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



Sun, 14 Aug 2005 08:26:12 GMT  
 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



Mon, 15 Aug 2005 02:39:57 GMT  
 Re-arrange this code so it works

AHA!!

I am with you. Thanks for that. I will figure that now tht
you have given me the hint.

Thanks
Adrian
PS Nicely answered. This way I get my question answered
and I learn too. Thanks

Quote:
>-----Original Message-----
>>     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
>>     shp.WrapFormat
>equals
>>     Selection.ShapeRange.WrapFormat

>or
>> 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



>> 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

>.



Mon, 15 Aug 2005 18:27:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. old code - new browser - code doesn't work

2. Rearrange Data?

3. how to rearrange column order

4. Rearranging items within a Listbox with Drag/Drop?

5. Algorithm to rearrange numbers

6. Rearranging Fields

7. API for rearranging desktop icons?

8. Rearrange SSTABs

9. Rearranging Minimizing Window icons

10. Rearranging minimized Windows Icons

11. ListView - Dragging Items to Rearrange Rows

12. sstab - how to rearrange the tab-order

 

 
Powered by phpBB® Forum Software