Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Tue, 8 Jul 2008 09:19:11 -0700,    group: microsoft.public.visio.developer        back       


Ctrl-C/Ctrl-X/Ctrl-V - How to catch.   
I noticed in the documentation that I can not catch the copy/cut/paste key 
events. I would like to be able to catch these and so I thought I would add 
my own event handler to catch these keys so that visio does not process the 
cut/copy/paste. I want to process this operation because I have special 
configurations that need to be done. 

Is making an event handler with the add advise going to do this or is there 
a better way? 

Thank you.
date: Tue, 8 Jul 2008 09:19:11 -0700   author:   Stumple

RE: Ctrl-C/Ctrl-X/Ctrl-V - How to catch.   
Hi, I have an example to catch when you 
are going to copy.
To try this code, put this code in ThisDocument,
and enter run mode, but not limited to key-in, sorry.

The message appears when you enter "Cntl+C"
or when you select menu "Copy".

Private WithEvents m_visApp As Visio.Application

Private Sub Document_RunModeEntered(ByVal doc As IVDocument)
  Set m_visApp = ThisDocument.Application
End Sub

Private Sub m_visApp_EnterScope(ByVal app As IVApplication, ByVal nScopeID 
As Long, ByVal bstrDescription As String)

  If nScopeID = Visio.VisUICmds.visCmdUFEditCopy Then
    MsgBox "Hi, you are going to copy!"
  End If

End Sub

-- 
Best Regards.

JuneTheSecond
Now the Visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
date: Wed, 9 Jul 2008 22:03:01 -0700   author:   JuneTheSecond \)cotton.ocn.ne.jp yodaju62(o@o

Re: Ctrl-C/Ctrl-X/Ctrl-V - How to catch.   
Don't forget Duplicate too...and Cut/Paste

"JuneTheSecond )cotton.ocn.ne.jp>" <yodaju62(<o@o> wrote in message 
news:764FF376-0A2A-46A3-AA47-98354F649CD0@microsoft.com...
> Hi, I have an example to catch when you
> are going to copy.
> To try this code, put this code in ThisDocument,
> and enter run mode, but not limited to key-in, sorry.
>
> The message appears when you enter "Cntl+C"
> or when you select menu "Copy".
>
> Private WithEvents m_visApp As Visio.Application
>
> Private Sub Document_RunModeEntered(ByVal doc As IVDocument)
>  Set m_visApp = ThisDocument.Application
> End Sub
>
> Private Sub m_visApp_EnterScope(ByVal app As IVApplication, ByVal nScopeID
> As Long, ByVal bstrDescription As String)
>
>  If nScopeID = Visio.VisUICmds.visCmdUFEditCopy Then
>    MsgBox "Hi, you are going to copy!"
>  End If
>
> End Sub
>
> -- 
> Best Regards.
>
> JuneTheSecond
> Now the Visual calculation is more visual.
> http://www.geocities.jp/visualcalculation/english/index.html
>

-- 
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com
date: Thu, 10 Jul 2008 10:48:41 +0100   author:   David Parker

RE: Ctrl-C/Ctrl-X/Ctrl-V - How to catch.   
I actually ended up catching the keyboard events and did it that way. This is 
nice too though! The problem I had was that I had no way to prevent visio 
from performing the paste which I was doing internally with .Paste(). I have 
figured a way around it but just for the knowledge is there anyway to keep 
visio from making the paste?

Thanks.

"JuneTheSecond" wrote:

> Hi, I have an example to catch when you 
> are going to copy.
> To try this code, put this code in ThisDocument,
> and enter run mode, but not limited to key-in, sorry.
> 
> The message appears when you enter "Cntl+C"
> or when you select menu "Copy".
> 
> Private WithEvents m_visApp As Visio.Application
> 
> Private Sub Document_RunModeEntered(ByVal doc As IVDocument)
>   Set m_visApp = ThisDocument.Application
> End Sub
> 
> Private Sub m_visApp_EnterScope(ByVal app As IVApplication, ByVal nScopeID 
> As Long, ByVal bstrDescription As String)
> 
>   If nScopeID = Visio.VisUICmds.visCmdUFEditCopy Then
>     MsgBox "Hi, you are going to copy!"
>   End If
> 
> End Sub
> 
> -- 
> Best Regards.
> 
> JuneTheSecond
> Now the Visual calculation is more visual.
> http://www.geocities.jp/visualcalculation/english/index.html
>
date: Thu, 10 Jul 2008 09:21:00 -0700   author:   Stumple

RE: Ctrl-C/Ctrl-X/Ctrl-V - How to catch.   
Stumple,

You have only to add ,,,
  If nScopeID = Visio.VisUICmds.visCmdUFEditCut Then
    MsgBox "Hi, you are going to cut!"
  End If

  If nScopeID = Visio.VisUICmds.visCmdUFEditPaste Then
    MsgBox "Hi, you are going to paste!"
  End If
and, if you include lines to delete the pasted shapes, 
you might prevent anyone from pasting.

-- 
Best Regards.

JuneTheSecond
Now the Visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
date: Fri, 11 Jul 2008 16:53:00 -0700   author:   JuneTheSecond \)cotton.ocn.ne.jp yodaju62(o@o

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us