I can't adjust text round a picture

I

Isabel

I insert a picture with a macro, and it is alwais over o behind, I can't
adjust de text round de picture.

I wrote:

ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes. _
AddPicture(Imagen, False, True).Name = "ImgPpal"

With
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes("ImgPpal")

.LockAspectRatio = True
.Width = CentimetersToPoints(2) 'Ancho
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = (-1) * (Imagen.Width / 2)
.Top = (-1) * Imagen.Width
.LockAnchor = False
.PictureFormat.ColorType = msoPictureAutomatic
.WrapFormat.Type = wdWrapSquare
.WrapFormat.Side = wdWrapBoth
.WrapFormat.DistanceRight = CentimetersToPoints(0.5)
.WrapFormat.DistanceLeft = CentimetersToPoints(0.5)
.WrapFormat.DistanceBottom = CentimetersToPoints(0.5)
.WrapFormat.DistanceTop = CentimetersToPoints(0.5)
End With

Thank You.
 
J

Jean-Guy Marcil

Isabel was telling us:
Isabel nous racontait que :
I insert a picture with a macro, and it is alwais over o behind, I
can't adjust de text round de picture.

I wrote:

ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes.
_ AddPicture(Imagen, False, True).Name = "ImgPpal"

With
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes("ImgPpal")

.LockAspectRatio = True
.Width = CentimetersToPoints(2) 'Ancho
.RelativeHorizontalPosition =
wdRelativeHorizontalPositionMargin
.RelativeVerticalPosition =
wdRelativeVerticalPositionMargin .Left = (-1) *
(Imagen.Width / 2) .Top = (-1) * Imagen.Width
.LockAnchor = False .PictureFormat.ColorType =
msoPictureAutomatic .WrapFormat.Type = wdWrapSquare
.WrapFormat.Side = wdWrapBoth
.WrapFormat.DistanceRight = CentimetersToPoints(0.5)
.WrapFormat.DistanceLeft = CentimetersToPoints(0.5)
.WrapFormat.DistanceBottom = CentimetersToPoints(0.5)
.WrapFormat.DistanceTop = CentimetersToPoints(0.5)
End With

Thank You.

Try this, it works on my machine:

'_______________________________________
Dim Imagen As String
Dim shpPix As Shape

Imagen = "C:\Test.jpg"

Set shpPix = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary) _
.Shapes.AddPicture(Imagen, False, True)

With shpPix
.Name = "ImgPal"
.LockAspectRatio = True
.Width = CentimetersToPoints(2)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = (-1) * (shpPix.Width / 2)
.Top = (-1) * shpPix.Width
.LockAnchor = False
.PictureFormat.ColorType = msoPictureAutomatic
.WrapFormat.Type = wdWrapSquare
.WrapFormat.Side = wdWrapBoth
.WrapFormat.DistanceRight = CentimetersToPoints(0.5)
.WrapFormat.DistanceLeft = CentimetersToPoints(0.5)
.WrapFormat.DistanceBottom = CentimetersToPoints(0.5)
.WrapFormat.DistanceTop = CentimetersToPoints(0.5)
End With
'_______________________________________

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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