Roderick
11-04-2017, 10:19 AM
I want to insert a number of pictures around my document after various paragraphs.
This is the code I have at the moment:
Dim Shp as Shape
Set Shp = Selection.InlineShapes.AddPicture(fileName:= strPicFile, _
LinkToFile:=False, SaveWithDocument:=True).ConvertToShape
With Shp
.WrapFormat.Type = wdWrapTight
End With
With Selection
.Collapse wdCollapseEnd
.TypeParagraph
End With
It does the job perfectly.
However, when I move to another blank paragraph further down the document and run this procedure again, it actually finds the first figure and places the new picture on top of it!
How can I get the new picture to be added where my cursor is located, please?
This is the code I have at the moment:
Dim Shp as Shape
Set Shp = Selection.InlineShapes.AddPicture(fileName:= strPicFile, _
LinkToFile:=False, SaveWithDocument:=True).ConvertToShape
With Shp
.WrapFormat.Type = wdWrapTight
End With
With Selection
.Collapse wdCollapseEnd
.TypeParagraph
End With
It does the job perfectly.
However, when I move to another blank paragraph further down the document and run this procedure again, it actually finds the first figure and places the new picture on top of it!
How can I get the new picture to be added where my cursor is located, please?