Returning the value of a InlineShape

J

Jill E

Hi,

I am trying to return the value of a combobox that I have inserted into a
Word document. It is not a formfield because my list needs to consist of
more than 25 members. As a result, I inserted a VBA control directly into
the document.

After doing this, I initialized the objects in the normal way, but haven't
been able to isolate the code to return the current value. I was able to
determine that controls inserted in this fashion are viewed programmatically
as an inlineshape, and so far everything points to this being correct.
Unfortunately I haven't found any documentation where the inlineshape is
anything other than a graphic object.

Could it be...

activedocument.inlineshapes(1).????


Can someone please send me in the right direction?

Desperate for help!

Thanks,
Jill
 
H

Helmut Weber

Hi Jill,

like:

With ActiveDocument.InlineShapes(1).OLEFormat.Object
MsgBox .Value
End With

You might want to check the type, too:

' wdInlineShapeOLEControlObject = 5
If ActiveDocument.InlineShapes(1).Type = 5 Then
MsgBox "yes"
End If

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top