VBA Command Button

J

John Viall

I have another quick question. I have a VBA button on my document, how can I
make it so that it won't print with the document?

Also, is there anyway to make if call up a toolbar with the command set to a
button on the toolbar? If so, how do I do it?

Thanks,
John
 
J

John Viall

Thanks for your prompt help. I have another question however, how can I
identify the shape number?

activeDocument.shapes(1).Visible = msoFalse

When I try the code as presented, I get an error and suspect that it is
related to the number of the shape.

Or can I reference the button by it's name?

Thanks,
John
 
J

Jay Freedman

Probably what's happening is that the command button is in line with text
rather than floating. In VBA, that means it's a member of the InlineShapes
collection instead of the Shapes collection, so it's probably
ActiveDocument.InlineShapes(1) unless there are other inline shapes that
come before it.

The next problem is that InlineShape objects don't have a .Visible property,
so you would have to use the Text Wrapping button on the Picture toolbar to
change the button from Inline to one of the other settings such as Square.
Alternatively, in the Tools > Options > General dialog, change the default
wrapping to something other than In Line With Text and then re-insert the
button.

There's some information about addressing in the "Referencing ActiveX
Controls in VBA Code" section of
http://msdn2.microsoft.com/en-us/library/aa140269(office.10).aspx.

Again, I'll suggest that you'd be much better served by using a toolbar
button instead of a command button.
 
J

John Viall

After your previous post, I decided to go ahead with that toolbar idea.
Thanks for the help, and for all the links.

John
 

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