Right Click Event?

J

jille

Hi,

I want to activate help files that I have created when the user right-clicks
on a field within my userform. I did a bit of research but can only find
reference to enabling the standard shortcut menu on a right click.

Can I write a different right click event for different objects on my user
form, and if so, what would it look like?

Thanks,
Jille
 
H

Helmut Weber

Hi,

like this:

Private Sub TextBox3_MouseUp(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Button = 2 Then
MsgBox "this is the right mouse button"
End If
End Sub

You may have to play a bit with this,
depending on the mouse you've got.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
T

Tuarek

How can we control the right click event in main Word document not on userform?
And how can we disable copy or paste command?
 
H

Helmut Weber

Hi Tuarek,

see: http://word.mvps.org/faqs/macrosvba/AppClassEvents.htm

oApp_WindowBeforeRightClick
How can we control the right click event in main Word
document not on userform?
And how can we disable copy or paste command?

In theory, yes. Intersect copying and pasting.
In practise, after each solution there is another problem.
You won't get far with this.

Word isn't made for disabling it's functionality.
I don't know what you want to do.
But this seems to be a case for Adobe Acrobat.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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