Start BuildFreeForm from a commandbutton?

I

Ian M

Hi,

I have been working with VBA to plot shapes on top of scanned maps with
some success. As usual, i now want to do more! I want to allow my users
to draw a freeform shape directly onto the map, from which I can then
find the x,y of each corner. The Draw/Freeform line method which I see
from a macro uses the BuildFreeForm and can produce an array of nodes
for the corners is ideal.

However, I would like my users just to have to click a commandbutton to
invoke it, not to have to know where to find it within the draw
toolbar. Any clues as to how I set this up?

I have read around event handling, but this seems to operate only
within a chart object. I don't have a chart object, just a picture
object (i.e. the scanned map). I would prefer to use the freeform
method as it easily allows graphical editing of the points to add,
delete or move them, but any technique that allows such editing via
mouse cursor position would be ok.

Any help or advice would be appreciated.

Ian.
 
T

Tom Ogilvy

Easier would be to create a custom toolbar

Tools=>Customize, then select the new button from the first tab in the
dialog. Give your toolbar a name.

Now go down to the drawing toolbar and select AutoShapes, Lines, Freeform.
Hold down the ctrl Key while you drag the Freeform button to your new
toolbar and release.

Now drop the Customize dialog box.

Now they don't have to look for it or for your command button. It can float
over your worksheet/map ( if you want to customize the appearance, such as
show the label, you can do this by right clicking on the button while the
customize dialog box is showing)
 

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