Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How could I Find all the existing InlineShapes in a Word Document ?

292 views
Skip to first unread message

Peleg

unread,
Mar 25, 2004, 5:14:04 AM3/25/04
to
Hi All,


I wrote an Addin(in VBA) that insert an ActiveX Control to a word
document. This ActiveX Control could be inserted to any place(Object)
in a Word document (Document,Text Box, Flow Chart etc. by this I mean
that I could not find my ActiveX control only in
ActiveDocument.InlineShapes but also in ActiveDocument.StoryRanges and
other places).
I am searching for a way to find all the existing InlineShapes in a
Word Document , or a way to find all my ActiveX controls in the
Document.

Thanks In advanced,
Peleg Atar.

Christian Freßdorf

unread,
Mar 25, 2004, 5:36:26 AM3/25/04
to
Hi Peleg,

> I am searching for a way to find all the existing InlineShapes in a
> Word Document , or a way to find all my ActiveX controls in the
> Document.

you can try the following workaround to find your control as
InlineShape by using the AlternativeText when you insert it:

Sub InsertControl()
Dim iShape As InlineShape
Set iShape = ActiveDocument.InlineShapes.AddPicture("C:\test.PNG", _
False, True)
iShape.AlternativeText = "Test"
End Sub

Sub SearchInlineShape()
Dim iShape As InlineShape
For Each iShape In ActiveDocument.InlineShapes
If iShape.AlternativeText = "Test" Then iShape.Select
Next iShape
End Sub

HTH

--
regards Christian
~~~~~~~~~~~~~~~~
reply only to this newsgroup
http://www.mvps.org/word/FindHelp/Posting.htm
http://support.microsoft.com/default.aspx?scid=fh;DE;NGNetikette

Peleg

unread,
Mar 25, 2004, 11:30:50 AM3/25/04
to
Hi Christian,
Thanks for your answer.
I think your solution could not help me. Because I need to find my
control all over the document. For example I could have many instances
of my Control in the foloowing places:
In ActiveDocument.InlineShapes
and In ActiveDocument.StoryRanges.InlineShapes
and another one in ActiveDocument.Shapes.Item1.TextFrame.ContainingRange.InlineShapes

I would like to perform a search that returns all the existing
inlinesapes (better solution returns the only my inlineShapes)

Thanks peleg.

Christian Freßdorf <ungu...@nurfuerspam.de> wrote in message news:<6zsxbk6m...@zaphod-systems.de>...

0 new messages