PDA

View Full Version : Wrap image behind text



babsiee
12-19-2013, 05:28 AM
With my macro I attach a full size a4 image in the header of my file. It goes well but when I type it does not what I would like to.

If I write a sentence in my document the first rule goes fine, but if my text is longer then it continues writing on a second page. So I cannot type more then 1 rule. When I manually wrap the image behind the text it goes find.

I would like to have the image to be wrapped behind the text. How do I include this in my macro?

Any ideas would be highly appreciated.


This is the code I use:

Sub attachimage_clicktwee()

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader


Dim oDialog As Word.Dialog


' \\ Get a handle to the Insert picture dialog
Set oDialog = Dialogs(wdDialogInsertPicture)


' \\ Work with dialog
With oDialog
' \\ Display the dialog
.Display


' \\Insert Shape Picture if the Name property (Filepath) <> ""
' \\ Set Left, Top, Width and Height properties to position the shape
If .Name <> "" Then
ActiveDocument.Shapes.AddPicture FileName:=.Name, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=370, _
Top:=-90, _
Width:=595, _
Height:=842, _
Anchor:=Selection.Range
FloatBehindText = True
End If
End With




' \\ Clean up
Set oDialog = Nothing


End Sub

westconn1
12-24-2013, 04:23 AM
try like
Dim pic As Shape
Set pic = ActiveDocument.Shapes.AddPicture(FileName:="C:\Documents and Settings\pete\My Documents\My Pictures\westconn.bmp", _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=370, _
Top:=-90, _
Width:=595, _
Height:=842, _
Anchor:=Selection.Range)
pic.WrapFormat.Type = wdWrapNone