How do you hide a OLEControl in Word?

G

Gail Hurn

I am using the AddOLEControl to add an OLE object to a Word document. I
would like to make the control invisible sometimes. Is there a way to do
that?

Here's a snipet of code. This code adds the object, but it is only
invisible when you're in Design mode, not all the time.


Dim newShape As Shape
Set newShape = Shapes.AddOLEControl("Forms.CheckBox.1")
newShape.Visible = msoFalse


Thanks
 
C

Cindy M.

Hi =?Utf-8?B?R2FpbCBIdXJu?=,
I am using the AddOLEControl to add an OLE object to a Word document. I
would like to make the control invisible sometimes. Is there a way to do
that?

Here's a snipet of code. This code adds the object, but it is only
invisible when you're in Design mode, not all the time.


Dim newShape As Shape
Set newShape = Shapes.AddOLEControl("Forms.CheckBox.1")
newShape.Visible = msoFalse
While Word handles the control as a graphic, what "makes it tick" is the OLE
interface (like an Excel workbook). If you check the properties of the
Checkbox control you'll see there is no Visible property available, so you
can't hide it. You could draw a box over it (no border, white fill), but
that would be pretty much all.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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