How to control visio enter scope commands.

S

Stumple

I am trying to control visio and keep it from doing things I don't want it to
do.
I started off by trying to stop visio from performing a cut when the user
presses ctrl-x. I handled this by deleting the accel item that allows this to
happen.

The problem is now when I hit ctrl-x a text edit box comes up. I have
tracked this down in my visio event handler and this is what is coming
through.
There are 4 commands that come through and they are as follows:
1035 as Actual size
1035 as Actual size (again)
1400 as Set Text <----- I think this is the culprit

Then after I click off the shape I get
1400 Last Zoom
1400 Last Zoom (again)


I think that if I could prevent visio from doing the 1400 "Set Text" command
I would be ok. How can I do this? Where is this command coming from?

Set text is causing my shape to not be selected anymore after a user has
selected it and hit ctrl-x. I rely on the selection to do a cut/paste.
Thanks.
 
S

Stumple

I figured out what event it is.

VisEventCodes.visEvtCodeShapeBeforeTextEdit

Does anyone know how to cancel this event so that the text edit box does not
come up?

Thanks.
 
J

John Goldsmith \(Visio MVP\)

Hello Stumple,

It might be better to remove the accelerator key to prevent the event from
firing in the first place. Have a look at the download at the bottom of
this blog post:
http://visualsignals.typepad.co.uk/vislog/2008/02/hiding-pages-wi.html
....where I disable the Page Up / Down keys.

You can do this on a document by document basis using the UIObject. See
this for reference:
http://msdn.microsoft.com/en-us/library/aa201792(office.10).aspx

Also, if you're going to start playing with your UI, then you might want to
save your existing menus and toolbars layout as per this post:
http://visualsignals.typepad.co.uk/vislog/2008/05/taming-your-too.html

Hope that helps.

Best regards

John


John Goldsmith (Visio MVP)
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk
 
S

Stumple

I have been trying to find the accel item for this. I looked through the
accel tables and didn't see it. Then I tried deleting all of the accel items
and that appeared to have reset them instead of deleting them all. If I
delete a few of them the ones I want to delete are deleted.

So what I have done is deleted the ctrl-x keyboard command. I deleted the
accel item and that works fine. Visio does not delete the shape off the page
now. The problem is; visio now sends some type of text edit command to the
document and so instead of cutting (ctrl-x) it now opens a text editing
window which I have been able to catch in my event handler.

I added an event handler for visEvtCodeShapeBeforeTextEdit and that catches
it. I just do not know where it comes from or who is sending this code down.

Thanks.
 

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