P
Post Tenebras Lux
I would like to cycle thru the inline shapes collection to change the
wrapformat property of each shape to wdWrapTight.
My code:
Dim shp as Shape
Dim shps as Shapes
set shps = ActiveDocument.Shapes
For Each shp in shps
if shp.Type = msoPicture then
with shp
.Wrapformat.AllowOverlap = True
.WrapFormat.Type = wdWrapTight
end with
End if
Next 'shp
This doesn't seem to do anything to the document's pictures (though it does
run).
I've tried using a collection of inlineshapes, but that doesn't seem to
allow the .WrapFormat property
Using record macro, I get the following code:
Selection.ShapeRange.WrapFormat.Type = wdWrapTight
but I can't figure out how to use this syntax with a collections object, to
go through all the pictures in the document.
What am I doing wrong?
A second minor question: Using the Watch window, I can see the shape
properties of the current shp object. How can I match the ID or name of the
shape object to the actual picture object in the document, so that I can
visually check that something is happening to it (I have a lot of pictures in
this document - and I don't know which is the current shape object my code is
working on). I can't find anyway to show the properties of the picture
object in Normal (or any other view).
Thanks!
wrapformat property of each shape to wdWrapTight.
My code:
Dim shp as Shape
Dim shps as Shapes
set shps = ActiveDocument.Shapes
For Each shp in shps
if shp.Type = msoPicture then
with shp
.Wrapformat.AllowOverlap = True
.WrapFormat.Type = wdWrapTight
end with
End if
Next 'shp
This doesn't seem to do anything to the document's pictures (though it does
run).
I've tried using a collection of inlineshapes, but that doesn't seem to
allow the .WrapFormat property
Using record macro, I get the following code:
Selection.ShapeRange.WrapFormat.Type = wdWrapTight
but I can't figure out how to use this syntax with a collections object, to
go through all the pictures in the document.
What am I doing wrong?
A second minor question: Using the Watch window, I can see the shape
properties of the current shp object. How can I match the ID or name of the
shape object to the actual picture object in the document, so that I can
visually check that something is happening to it (I have a lot of pictures in
this document - and I don't know which is the current shape object my code is
working on). I can't find anyway to show the properties of the picture
object in Normal (or any other view).
Thanks!