K
Kate Moncrieff
Hi,
I have a macro which inserts and ungroups a metafile
picture as follows:
With ActiveDocument
.Shapes.AddPicture FileName:=vrtSelectedItem,
LinkToFile:=False, SaveWithDocument:=True
.Shapes(.Shapes.Count).Ungroup
End With
The next thing I want to do is to select the part of the
ungrouped image that contains the background and change
the colour of it to "No fill". (To do this manually in
Word, I right-click on that part of the picture,
select "Format Autoshape" and change the Fill.Color value
on the "Colors and Lines" page.)
From the online help, it seems that what I need to do is
to select the appropriate (auto)shape that was generated
by the .UnGroup command and change the .Fill.Visible
property of it to msoFalse.
My problem is that, even after the ungrouping, vb doesn't
seem to recognize that the document now contains several
shapes instead of just the original one; the value of
ActiveDocument.Shapes.Count is still 1. (This is despite
the fact that the ungrouping has apparently worked and I
can select different parts of the image individually.)
Could anyone tell me how I can write code to select just a
part of the ungrouped image so that I can change the fill
colour? (In case it's relevant, I've noticed that when I
do what I need to do manually, the thing I have to click
on in order to get the "Format Autoshape" option doesn't
seem to be a fully-fledged shape; when selected, it's
surrounded by little circles, not a thick stripy line.)
Can anyone help?
Many thanks!
Kate
PS I did ask something similar before and got some
helpful answers. I thought I'd solved the problem but,
when I tried on a machine with Windows 2000, it still
didn't seem to work
I have a macro which inserts and ungroups a metafile
picture as follows:
With ActiveDocument
.Shapes.AddPicture FileName:=vrtSelectedItem,
LinkToFile:=False, SaveWithDocument:=True
.Shapes(.Shapes.Count).Ungroup
End With
The next thing I want to do is to select the part of the
ungrouped image that contains the background and change
the colour of it to "No fill". (To do this manually in
Word, I right-click on that part of the picture,
select "Format Autoshape" and change the Fill.Color value
on the "Colors and Lines" page.)
From the online help, it seems that what I need to do is
to select the appropriate (auto)shape that was generated
by the .UnGroup command and change the .Fill.Visible
property of it to msoFalse.
My problem is that, even after the ungrouping, vb doesn't
seem to recognize that the document now contains several
shapes instead of just the original one; the value of
ActiveDocument.Shapes.Count is still 1. (This is despite
the fact that the ungrouping has apparently worked and I
can select different parts of the image individually.)
Could anyone tell me how I can write code to select just a
part of the ungrouped image so that I can change the fill
colour? (In case it's relevant, I've noticed that when I
do what I need to do manually, the thing I have to click
on in order to get the "Format Autoshape" option doesn't
seem to be a fully-fledged shape; when selected, it's
surrounded by little circles, not a thick stripy line.)
Can anyone help?
Many thanks!
Kate
PS I did ask something similar before and got some
helpful answers. I thought I'd solved the problem but,
when I tried on a machine with Windows 2000, it still
didn't seem to work