D
david_alex_smith
Hello
We generate word documents from content in a database (AuthorIT
application). I want to have an image on the front page of my document
_behind_ the text. When generated, the text is wrapped around the image. I
want to use a macro to set the image to display beneath the text.
I have come up with this macro:
Sub MoveImage()
Dim iShape, Shape
On Error Resume Next
For Each iShape In ActiveDocument.Sections.First.Range.InlineShapes
iShape.ConvertToShape
Next
For Each Shape In ActiveDocument.Sections.First.Range.ShapeRange
Shape.WrapFormat.Type = wdWrapThrough
Next
End Sub
This doesn't work when run as soon as the doc is generated, but curiously
does work if i manually select the image then run it.
Can anyone help me to develop a macro that will set the desired wrapping
without any manual action?
Thanks
Dave.
We generate word documents from content in a database (AuthorIT
application). I want to have an image on the front page of my document
_behind_ the text. When generated, the text is wrapped around the image. I
want to use a macro to set the image to display beneath the text.
I have come up with this macro:
Sub MoveImage()
Dim iShape, Shape
On Error Resume Next
For Each iShape In ActiveDocument.Sections.First.Range.InlineShapes
iShape.ConvertToShape
Next
For Each Shape In ActiveDocument.Sections.First.Range.ShapeRange
Shape.WrapFormat.Type = wdWrapThrough
Next
End Sub
This doesn't work when run as soon as the doc is generated, but curiously
does work if i manually select the image then run it.
Can anyone help me to develop a macro that will set the desired wrapping
without any manual action?
Thanks
Dave.