A
Andrew
I want to allow users to move ole objects (images) on the worksheet by
dragging them with the mouse. I can think of three ways to achieve
this (sort of).
1) Switch into design mode. I'm not sure if there is code that will
allow me to do this though - anyone?
2) Trap the object MouseDown, Up and Move events and reposition the
object based on current mouse position. My concern with this one is
that I will overload XL since the event will fire continuously and xl
will have to keep re-drawing the image.
3) Trap the object MouseDown event and create a new mouse pointer icon
(eg. a dashed box) then trap the MouseUp event and reposition the
object to this position. The problem with this one is that I really
need
to create the mouse icon on the fly to get the pointer in the right
position in the box image. Any ideas
how I could do this?
Are my concerns in (2) justified? Does anyone have any other
thoughts/ options/ concerns before I go too far
down one track.
This is also an issue for inserting the objects in the first place. I
think for this option 3 would work
best but I don't know if there is a better approach that allows more
control over inserting objects - some
API calls perhaps? Rather than going as far as inserting the object
(which .OLEObjects.Add does) I want to stop at the point where the
object is ready for the user to place it on the sheet.
I am using ole image objects rather than pictures or drawing objs
because they allow me to create a right
click menu and I can change the image within the same object to
reflect different user choices. Also I can
"discourage" the user from copy/pasting the image.
Thanks a lot,
Andrew
dragging them with the mouse. I can think of three ways to achieve
this (sort of).
1) Switch into design mode. I'm not sure if there is code that will
allow me to do this though - anyone?
2) Trap the object MouseDown, Up and Move events and reposition the
object based on current mouse position. My concern with this one is
that I will overload XL since the event will fire continuously and xl
will have to keep re-drawing the image.
3) Trap the object MouseDown event and create a new mouse pointer icon
(eg. a dashed box) then trap the MouseUp event and reposition the
object to this position. The problem with this one is that I really
need
to create the mouse icon on the fly to get the pointer in the right
position in the box image. Any ideas
how I could do this?
Are my concerns in (2) justified? Does anyone have any other
thoughts/ options/ concerns before I go too far
down one track.
This is also an issue for inserting the objects in the first place. I
think for this option 3 would work
best but I don't know if there is a better approach that allows more
control over inserting objects - some
API calls perhaps? Rather than going as far as inserting the object
(which .OLEObjects.Add does) I want to stop at the point where the
object is ready for the user to place it on the sheet.
I am using ole image objects rather than pictures or drawing objs
because they allow me to create a right
click menu and I can change the image within the same object to
reflect different user choices. Also I can
"discourage" the user from copy/pasting the image.
Thanks a lot,
Andrew